Share via


AVAsset.Notifications.ObserveDurationDidChange Metodo

Definizione

Overload

ObserveDurationDidChange(EventHandler<NSNotificationEventArgs>)

Notifica fortemente tipizzata per la DurationDidChangeNotification costante.

ObserveDurationDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notifica fortemente tipizzata per la DurationDidChangeNotification costante.

ObserveDurationDidChange(EventHandler<NSNotificationEventArgs>)

Notifica fortemente tipizzata per la DurationDidChangeNotification costante.

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

Parametri

handler
EventHandler<NSNotificationEventArgs>

Gestore che risponde alla notifica quando si verifica.

Restituisce

Oggetto token che può essere usato per arrestare la ricezione delle notifiche eliminandolo o passandolo a RemoveObservers(IEnumerable<NSObject>)

Commenti

Questo metodo può essere usato per sottoscrivere DurationDidChangeNotification le notifiche.

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

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

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

Si applica a

ObserveDurationDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Notifica fortemente tipizzata per la DurationDidChangeNotification costante.

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

Parametri

objectToObserve
NSObject

Oggetto specifico da osservare.

handler
EventHandler<NSNotificationEventArgs>

Gestore che risponde alla notifica quando si verifica.

Restituisce

Oggetto token che può essere usato per arrestare la ricezione delle notifiche eliminandolo o passandolo a RemoveObservers(IEnumerable<NSObject>)

Commenti

Questo metodo può essere usato per sottoscrivere DurationDidChangeNotification le notifiche.

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

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

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

Si applica a