Partager via


PdfView.Notifications.ObserveDocumentChanged Méthode

Définition

Surcharges

ObserveDocumentChanged(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DocumentChangedNotification constante.

ObserveDocumentChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DocumentChangedNotification constante.

ObserveDocumentChanged(EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DocumentChangedNotification constante.

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

Paramètres

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lors de la publication de la notification.

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 DocumentChangedNotification s’abonner aux notifications.

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

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

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

S’applique à

ObserveDocumentChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Notification fortement typée pour la DocumentChangedNotification constante.

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

Paramètres

objectToObserve
NSObject

Objet à observer.

handler
EventHandler<NSNotificationEventArgs>

Méthode à appeler lors de la publication de la notification.

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 DocumentChangedNotification s’abonner aux notifications.

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

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

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

S’applique à