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


PdfView.Notifications.ObserveAnnotationWillHit Метод

Определение

Перегрузки

ObserveAnnotationWillHit(EventHandler<NSNotificationEventArgs>)

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

ObserveAnnotationWillHit(NSObject, EventHandler<NSNotificationEventArgs>)

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

ObserveAnnotationWillHit(EventHandler<NSNotificationEventArgs>)

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

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

Параметры

handler
EventHandler<NSNotificationEventArgs>

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

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

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

Комментарии

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

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

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

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

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

ObserveAnnotationWillHit(NSObject, EventHandler<NSNotificationEventArgs>)

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

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

Параметры

objectToObserve
NSObject

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

handler
EventHandler<NSNotificationEventArgs>

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

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

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

Комментарии

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

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

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

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

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