Compartir a través de


NSBundleResourceRequest.Notifications.ObserveLowDiskSpace Método

Definición

Sobrecargas

ObserveLowDiskSpace(EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la LowDiskSpaceNotification constante.

ObserveLowDiskSpace(NSObject, EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la LowDiskSpaceNotification constante.

ObserveLowDiskSpace(EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la LowDiskSpaceNotification constante.

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

Parámetros

handler
EventHandler<NSNotificationEventArgs>

Método que se invoca cuando se publica la notificación.

Devoluciones

Objeto token que se puede usar para dejar de recibir notificaciones mediante su eliminación o su paso a RemoveObservers(IEnumerable<NSObject>)

Comentarios

Este método se puede usar para suscribirse LowDiskSpaceNotification a las notificaciones.

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

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

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

Se aplica a

ObserveLowDiskSpace(NSObject, EventHandler<NSNotificationEventArgs>)

Notificación fuertemente tipada para la LowDiskSpaceNotification constante.

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

Parámetros

objectToObserve
NSObject

Objeto que se va a observar.

handler
EventHandler<NSNotificationEventArgs>

Método que se invoca cuando se publica la notificación.

Devoluciones

Objeto token que se puede usar para dejar de recibir notificaciones mediante su eliminación o su paso a RemoveObservers(IEnumerable<NSObject>)

Comentarios

Este método se puede usar para suscribirse LowDiskSpaceNotification a las notificaciones.

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

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

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

Se aplica a