Edytuj

Udostępnij za pośrednictwem


AVAssetTrack.Notifications.ObserveSegmentsDidChange Method

Definition

Overloads

ObserveSegmentsDidChange(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the SegmentsDidChangeNotification constant.

ObserveSegmentsDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the SegmentsDidChangeNotification constant.

ObserveSegmentsDidChange(EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the SegmentsDidChangeNotification constant.

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

Parameters

handler
EventHandler<NSNotificationEventArgs>

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 for SegmentsDidChangeNotification notifications.

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

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

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

Applies to

ObserveSegmentsDidChange(NSObject, EventHandler<NSNotificationEventArgs>)

Strongly typed notification for the SegmentsDidChangeNotification constant.

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

Parameters

objectToObserve
NSObject

The specific object to observe.

handler
EventHandler<NSNotificationEventArgs>

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 for SegmentsDidChangeNotification notifications.

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

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

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

Applies to