Поделиться через


PdfView.Notifications.ObserveDocumentChanged Метод

Определение

Перегрузки

ObserveDocumentChanged(EventHandler<NSNotificationEventArgs>)

Строго типизированное уведомление для константы DocumentChangedNotification .

ObserveDocumentChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Строго типизированное уведомление для константы DocumentChangedNotification .

ObserveDocumentChanged(EventHandler<NSNotificationEventArgs>)

Строго типизированное уведомление для константы DocumentChangedNotification .

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

Параметры

handler
EventHandler<NSNotificationEventArgs>

Метод, вызываемый при публикации уведомления.

Возвращаемое значение

Объект токена, который можно использовать для прекращения получения уведомлений путем удаления или передачи в RemoveObservers(IEnumerable<NSObject>)

Комментарии

Этот метод можно использовать для подписки на DocumentChangedNotification уведомления.

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

Применяется к

ObserveDocumentChanged(NSObject, EventHandler<NSNotificationEventArgs>)

Строго типизированное уведомление для константы DocumentChangedNotification .

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

Параметры

objectToObserve
NSObject

Объект для наблюдения.

handler
EventHandler<NSNotificationEventArgs>

Метод, вызываемый при публикации уведомления.

Возвращаемое значение

Объект токена, который можно использовать для прекращения получения уведомлений путем удаления или передачи в RemoveObservers(IEnumerable<NSObject>)

Комментарии

Этот метод можно использовать для подписки на DocumentChangedNotification уведомления.

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

Применяется к