編輯

共用方式為


PdfDocument.Notifications.ObserveDidFindMatch Method

Definition

Overloads

ObserveDidFindMatch(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the DidFindMatchNotification constant.

ObserveDidFindMatch(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the DidFindMatchNotification constant.

ObserveDidFindMatch(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the DidFindMatchNotification constant.

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

Parameters

handler
EventHandler<NSNotificationEventArgs>

Method to invoke when the notification is posted.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>)

Remarks

This method can be used to subscribe for DidFindMatchNotification notifications.

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

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

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

Applies to

ObserveDidFindMatch(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the DidFindMatchNotification constant.

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

Parameters

objectToObserve
NSObject

The object to observe.

handler
EventHandler<NSNotificationEventArgs>

Method to invoke when the notification is posted.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>)

Remarks

This method can be used to subscribe for DidFindMatchNotification notifications.

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

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

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

Applies to