PdfView.Notifications.ObservePrintPermission Method

Definition

Overloads

ObservePrintPermission(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the PrintPermissionNotification constant.

ObservePrintPermission(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the PrintPermissionNotification constant.

ObservePrintPermission(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the PrintPermissionNotification constant.

public static Foundation.NSObject ObservePrintPermission (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObservePrintPermission : 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 PrintPermissionNotification notifications.

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

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

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

Applies to

ObservePrintPermission(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the PrintPermissionNotification constant.

public static Foundation.NSObject ObservePrintPermission (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObservePrintPermission : 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 PrintPermissionNotification notifications.

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

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

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

Applies to