MPMoviePlayerController.Notifications.ObserveTimedMetadataUpdated Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
ObserveTimedMetadataUpdated(NSObject, EventHandler<MPMoviePlayerTimedMetadataEventArgs>) |
Notifica fortemente tipizzata per la TimedMetadataUpdatedNotification costante. |
ObserveTimedMetadataUpdated(EventHandler<MPMoviePlayerTimedMetadataEventArgs>) |
Notifica fortemente tipizzata per la TimedMetadataUpdatedNotification costante. |
ObserveTimedMetadataUpdated(NSObject, EventHandler<MPMoviePlayerTimedMetadataEventArgs>)
Notifica fortemente tipizzata per la TimedMetadataUpdatedNotification costante.
public static Foundation.NSObject ObserveTimedMetadataUpdated (Foundation.NSObject objectToObserve, EventHandler<MediaPlayer.MPMoviePlayerTimedMetadataEventArgs> handler);
static member ObserveTimedMetadataUpdated : Foundation.NSObject * EventHandler<MediaPlayer.MPMoviePlayerTimedMetadataEventArgs> -> Foundation.NSObject
Parametri
- objectToObserve
- NSObject
Oggetto da osservare.
Metodo da richiamare quando viene pubblicata la notifica.
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 TimedMetadataUpdatedNotification le notifiche.
// Listen to all notifications posted for any object
var token = MPMoviePlayerController.Notifications.ObserveTimedMetadataUpdated ((notification) => {
Console.WriteLine ("Observed TimedMetadataUpdatedNotification!");
};
// Listen to all notifications posted for a single object
var token = MPMoviePlayerController.Notifications.ObserveTimedMetadataUpdated (objectToObserve, (notification) => {
Console.WriteLine ($"Observed TimedMetadataUpdatedNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();
Si applica a
ObserveTimedMetadataUpdated(EventHandler<MPMoviePlayerTimedMetadataEventArgs>)
Notifica fortemente tipizzata per la TimedMetadataUpdatedNotification costante.
public static Foundation.NSObject ObserveTimedMetadataUpdated (EventHandler<MediaPlayer.MPMoviePlayerTimedMetadataEventArgs> handler);
static member ObserveTimedMetadataUpdated : EventHandler<MediaPlayer.MPMoviePlayerTimedMetadataEventArgs> -> Foundation.NSObject
Parametri
Metodo da richiamare quando viene pubblicata la notifica.
Restituisce
Oggetto token che può essere usato per arrestare la ricezione delle notifiche eliminandolo o passandolo a RemoveObservers(IEnumerable<NSObject>)
Commenti
Nell'esempio seguente viene illustrato come gli sviluppatori possono usare questo metodo nel codice:
//
// Lambda style
//
// listening
notification = MPMoviePlayerController.Notifications.ObserveTimedMetadataUpdated ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("TimedMetadata", args.TimedMetadata);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, MediaPlayer.MPMoviePlayerTimedMetadataEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
Console.WriteLine ("TimedMetadata", args.TimedMetadata);
}
void Setup ()
{
notification = MPMoviePlayerController.Notifications.ObserveTimedMetadataUpdated (Callback);
}
void Teardown ()
{
notification.Dispose ();
}