Compartir a través de


NSProcessInfo.ThermalStateDidChangeNotification Propiedad

Definición

Constante de notificación para ThermalStateDidChange

[Foundation.Advice("Use NSProcessInfo.Notifications.ObserveThermalStateDidChange helper method instead.")]
[Foundation.Field("NSProcessInfoThermalStateDidChangeNotification", "Foundation")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 10, 3, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.WatchOS, 4, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSString ThermalStateDidChangeNotification { [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 10, 3, ObjCRuntime.PlatformArchitecture.All, null)] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.WatchOS, 4, 0, ObjCRuntime.PlatformArchitecture.All, null)] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.ThermalStateDidChangeNotification : Foundation.NSString

Valor de propiedad

La constante NSString debe usarse como token para NSNotificationCenter.

Atributos

Comentarios

Esta constante se puede usar con NSNotificationCenter para registrar un agente de escucha para esta notificación, además, los desarrolladores pueden usar la notificación ObserveThermalStateDidChange fuertemente tipada en su lugar. Se trata de un NSString en lugar de una cadena, ya que estos valores se pueden usar como tokens en algunas bibliotecas nativas en lugar de usarse exclusivamente para su contenido de cadena real. El parámetro "notification" de la devolución de llamada contiene información adicional específica del tipo de notificación.

// Lambda style
NSNotificationCenter.DefaultCenter.AddObserver (
        NSProcessInfo.ThermalStateDidChangeNotification, (notification) => {Console.WriteLine ("Received the notification NSProcessInfo", notification); }


// Method style
void Callback (NSNotification notification)
{
    Console.WriteLine ("Received a notification NSProcessInfo", notification);
}

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (NSProcessInfo.ThermalStateDidChangeNotification, Callback);
}

Se aplica a