Partager via


NSUserDefaults.Notifications.ObserveCompletedInitialSync Méthode

Définition

Surcharges

ObserveCompletedInitialSync(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la CompletedInitialSyncNotification constante.

ObserveCompletedInitialSync(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la CompletedInitialSyncNotification constante.

ObserveCompletedInitialSync(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la CompletedInitialSyncNotification constante.

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

Paramètres

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

Cette méthode peut être utilisée pour CompletedInitialSyncNotification s’abonner aux notifications.

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

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

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

S’applique à

ObserveCompletedInitialSync(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la CompletedInitialSyncNotification constante.

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

Paramètres

objectToObserve
NSObject

Objet à observer.

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lorsque la notification est publiée.

Retours

Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)

Remarques

Cette méthode peut être utilisée pour CompletedInitialSyncNotification s’abonner aux notifications.

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

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

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

S’applique à