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


PdfView.Notifications.ObserveChangedHistory Метод

Определение

Перегрузки

ObserveChangedHistory(EventHandler<NSNotificationEventArgs>)

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

ObserveChangedHistory(NSObject, EventHandler<NSNotificationEventArgs>)

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

ObserveChangedHistory(EventHandler<NSNotificationEventArgs>)

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

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

Параметры

handler
EventHandler<NSNotificationEventArgs>

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

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

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

Комментарии

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

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

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

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

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

ObserveChangedHistory(NSObject, EventHandler<NSNotificationEventArgs>)

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

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

Параметры

objectToObserve
NSObject

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

handler
EventHandler<NSNotificationEventArgs>

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

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

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

Комментарии

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

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

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

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

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