Share via


NSHttpCookieStorage.Notifications.ObserveAcceptPolicyChanged Método

Definición

Sobrecargas

ObserveAcceptPolicyChanged(EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la AcceptPolicyChangedNotification constante.

ObserveAcceptPolicyChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la AcceptPolicyChangedNotification constante.

ObserveAcceptPolicyChanged(EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la AcceptPolicyChangedNotification constante.

public static Foundation.NSObject ObserveAcceptPolicyChanged (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveAcceptPolicyChanged : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject

Parámetros

handler
EventHandler<NSNotificationEventArgs>

Método que se invoca cuando se publica la notificación.

Devoluciones

Objeto token que se puede usar para dejar de recibir notificaciones mediante su eliminación o su paso a RemoveObservers(IEnumerable<NSObject>)

Comentarios

Este método se puede usar para suscribirse AcceptPolicyChangedNotification a las notificaciones.

// Listen to all notifications posted for any object
var token = NSHttpCookieStorage.Notifications.ObserveAcceptPolicyChanged ((notification) => {
	Console.WriteLine ("Observed AcceptPolicyChangedNotification!");
};

// Listen to all notifications posted for a single object
var token = NSHttpCookieStorage.Notifications.ObserveAcceptPolicyChanged (objectToObserve, (notification) => {
	Console.WriteLine ($"Observed AcceptPolicyChangedNotification for {nameof (objectToObserve)}!");
};

// Stop listening for notifications
token.Dispose ();

Se aplica a

ObserveAcceptPolicyChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la AcceptPolicyChangedNotification constante.

public static Foundation.NSObject ObserveAcceptPolicyChanged (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveAcceptPolicyChanged : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject

Parámetros

objectToObserve
NSObject

Objeto que se va a observar.

handler
EventHandler<NSNotificationEventArgs>

Método que se invoca cuando se publica la notificación.

Devoluciones

Objeto token que se puede usar para dejar de recibir notificaciones mediante su eliminación o su paso a RemoveObservers(IEnumerable<NSObject>)

Comentarios

Este método se puede usar para suscribirse AcceptPolicyChangedNotification a las notificaciones.

// Listen to all notifications posted for any object
var token = NSHttpCookieStorage.Notifications.ObserveAcceptPolicyChanged ((notification) => {
	Console.WriteLine ("Observed AcceptPolicyChangedNotification!");
};

// Listen to all notifications posted for a single object
var token = NSHttpCookieStorage.Notifications.ObserveAcceptPolicyChanged (objectToObserve, (notification) => {
	Console.WriteLine ($"Observed AcceptPolicyChangedNotification for {nameof (objectToObserve)}!");
};

// Stop listening for notifications
token.Dispose ();

Se aplica a