AVCaptureDevice.Notifications.ObserveSubjectAreaDidChange Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
ObserveSubjectAreaDidChange(EventHandler<NSNotificationEventArgs>) |
Notification fortement typée pour la SubjectAreaDidChangeNotification constante. |
ObserveSubjectAreaDidChange(NSObject, EventHandler<NSNotificationEventArgs>) |
Notification fortement typée pour la SubjectAreaDidChangeNotification constante. |
ObserveSubjectAreaDidChange(EventHandler<NSNotificationEventArgs>)
Notification fortement typée pour la SubjectAreaDidChangeNotification constante.
public static Foundation.NSObject ObserveSubjectAreaDidChange (EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveSubjectAreaDidChange : EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject
Paramètres
- handler
- EventHandler<NSNotificationEventArgs>
Méthode à appeler lorsque la notification est publiée.
Retours
Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)
Remarques
L’exemple suivant montre comment utiliser cette méthode dans votre code
//
// Lambda style
//
// listening
notification = AVCaptureDevice.Notifications.ObserveSubjectAreaDidChange ((sender, args) => {
/* Access strongly typed args */
Console.WriteLine ("Notification: {0}", args.Notification);
});
// To stop listening:
notification.Dispose ();
//
//Method style
//
NSObject notification;
void Callback (object sender, Foundation.NSNotificationEventArgs args)
{
// Access strongly typed args
Console.WriteLine ("Notification: {0}", args.Notification);
}
void Setup ()
{
notification = AVCaptureDevice.Notifications.ObserveSubjectAreaDidChange (Callback);
}
void Teardown ()
{
notification.Dispose ();
}
S’applique à
ObserveSubjectAreaDidChange(NSObject, EventHandler<NSNotificationEventArgs>)
Notification fortement typée pour la SubjectAreaDidChangeNotification constante.
public static Foundation.NSObject ObserveSubjectAreaDidChange (Foundation.NSObject objectToObserve, EventHandler<Foundation.NSNotificationEventArgs> handler);
static member ObserveSubjectAreaDidChange : Foundation.NSObject * EventHandler<Foundation.NSNotificationEventArgs> -> Foundation.NSObject
Paramètres
- objectToObserve
- NSObject
Objet spécifique à observer.
- handler
- EventHandler<NSNotificationEventArgs>
Gestionnaire qui répond à la notification lorsqu’elle se produit.
Retours
Objet jeton qui peut être utilisé pour arrêter de recevoir des notifications en le supprimant ou en le transmettant à RemoveObservers(IEnumerable<NSObject>)
Remarques
Cette méthode peut être utilisée pour SubjectAreaDidChangeNotification s’abonner aux notifications.
// Listen to all notifications posted for any object
var token = AVCaptureDevice.Notifications.ObserveSubjectAreaDidChange ((notification) => {
Console.WriteLine ("Observed SubjectAreaDidChangeNotification!");
};
// Listen to all notifications posted for a single object
var token = AVCaptureDevice.Notifications.ObserveSubjectAreaDidChange (objectToObserve, (notification) => {
Console.WriteLine ($"Observed SubjectAreaDidChangeNotification for {nameof (objectToObserve)}!");
};
// Stop listening for notifications
token.Dispose ();