Share via


AVAudioSession.Notifications.ObserveMicrophoneInjectionCapabilitiesChange Method

Definition

Overloads

ObserveMicrophoneInjectionCapabilitiesChange(EventHandler<MicrophoneInjectionCapabilitiesChangeEventArgs>)

Strongly typed notification for the MicrophoneInjectionCapabilitiesChangeNotification constant.

public static Foundation.NSObject ObserveMicrophoneInjectionCapabilitiesChange(EventHandler<AVFoundation.MicrophoneInjectionCapabilitiesChangeEventArgs> handler);
static member ObserveMicrophoneInjectionCapabilitiesChange : EventHandler<AVFoundation.MicrophoneInjectionCapabilitiesChangeEventArgs> -> Foundation.NSObject

Parameters

handler
EventHandler<MicrophoneInjectionCapabilitiesChangeEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to MicrophoneInjectionCapabilitiesChangeNotification notifications.

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

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

Applies to

ObserveMicrophoneInjectionCapabilitiesChange(NSObject, EventHandler<MicrophoneInjectionCapabilitiesChangeEventArgs>)

Strongly typed notification for the MicrophoneInjectionCapabilitiesChangeNotification constant.

public static Foundation.NSObject ObserveMicrophoneInjectionCapabilitiesChange(Foundation.NSObject objectToObserve, EventHandler<AVFoundation.MicrophoneInjectionCapabilitiesChangeEventArgs> handler);
static member ObserveMicrophoneInjectionCapabilitiesChange : Foundation.NSObject * EventHandler<AVFoundation.MicrophoneInjectionCapabilitiesChangeEventArgs> -> Foundation.NSObject

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<MicrophoneInjectionCapabilitiesChangeEventArgs>

The handler that responds to the notification when it occurs.

Returns

Token object that can be used to stop receiving notifications by either disposing it or passing it to RemoveObservers(IEnumerable<NSObject>).

Remarks

This method can be used to subscribe to MicrophoneInjectionCapabilitiesChangeNotification notifications.

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

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

Applies to