共用方式為


NSProcessInfo.ThermalStateDidChangeNotification 屬性

定義

熱常數DidChange 的通知常數

[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

屬性值

NSString 常數應作為 NSNotificationCenter 的權杖使用。

屬性

備註

這個常數可以搭配 使用 NSNotificationCenter 來註冊此通知的接聽程式,而開發人員也可以改用強型別通知 ObserveThermalStateDidChange 。 這是 NSString 而不是字串,因為這些值可以當做某些原生程式庫中的標記使用,而不是單純用於其實際字串內容。 回呼的 'notification' 參數包含通知類型特有的額外資訊。

// 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);
}

適用於