次の方法で共有


AUAudioUnit.Notifications.ObserveAudioComponentInstanceInvalidation メソッド

定義

オーバーロード

ObserveAudioComponentInstanceInvalidation(EventHandler<NSNotificationEventArgs>)

定数の厳密に型指定された通知 AudioComponentInstanceInvalidationNotification

ObserveAudioComponentInstanceInvalidation(NSObject, EventHandler<NSNotificationEventArgs>)

定数の厳密に型指定された通知 AudioComponentInstanceInvalidationNotification

ObserveAudioComponentInstanceInvalidation(EventHandler<NSNotificationEventArgs>)

定数の厳密に型指定された通知 AudioComponentInstanceInvalidationNotification

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

パラメーター

handler
EventHandler<NSNotificationEventArgs>

通知が投稿されたときに呼び出すメソッド。

戻り値

通知を破棄するか、 に渡すことによって通知の受信を停止するために使用できる Token オブジェクト RemoveObservers(IEnumerable<NSObject>)

注釈

このメソッドは、通知を AudioComponentInstanceInvalidationNotification サブスクライブするために使用できます。

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

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

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

適用対象

ObserveAudioComponentInstanceInvalidation(NSObject, EventHandler<NSNotificationEventArgs>)

定数の厳密に型指定された通知 AudioComponentInstanceInvalidationNotification

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

パラメーター

objectToObserve
NSObject

観察するオブジェクト。

handler
EventHandler<NSNotificationEventArgs>

通知が投稿されたときに呼び出すメソッド。

戻り値

通知を破棄するか、 に渡すことによって通知の受信を停止するために使用できる Token オブジェクト RemoveObservers(IEnumerable<NSObject>)

注釈

このメソッドは、通知を AudioComponentInstanceInvalidationNotification サブスクライブするために使用できます。

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

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

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

適用対象