Compartir a través de


CBCentralManager.OptionNotifyOnNotificationKey Propiedad

Definición

Constante de notificación para OptionNotifyOnNot

[Foundation.Field("CBConnectPeripheralOptionNotifyOnNotificationKey", "CoreBluetooth")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 13, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSString OptionNotifyOnNotificationKey { [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.MacOSX, 10, 13, ObjCRuntime.PlatformArchitecture.All, null)] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 6, 0, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.OptionNotifyOnNotificationKey : Foundation.NSString

Valor de propiedad

La constante NSString se debe usar como token para NSNotificationCenter.

Atributos

Comentarios

Esta constante se puede usar con para NSNotificationCenter registrar un agente de escucha para esta notificación. 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 (
        CBCentralManager.OptionNotifyOnNotificationKey, (notification) => {Console.WriteLine ("Received the notification CBCentralManager", notification); }


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

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (CBCentralManager.OptionNotifyOnNotificationKey, Callback);
}

Se aplica a