CFNotificationCenter Class

Definition

Notification hub for the application.

public class CFNotificationCenter : IDisposable, ObjCRuntime.INativeObject
type CFNotificationCenter = class
    interface INativeObject
    interface IDisposable
Inheritance
CFNotificationCenter
Implements

Remarks

The CFNotificationCenter is a hub that is used to listen to broadcast messages and post broadcast messages in an application. The messages that are posted are synchronous.

Posting a notification is a synchronous process, which means that invoking one of the Post messages on the notification center will block execution until all of the notification handlers have completed running.

While the NSNotificationCenter also provides a notification hub, they are separate from each other. The CFNotificationCenter provides three hubs: an application local hub, the Darwin hub (for OS-global notifications) and a distributed hub (only available on Mac).

Properties

Darwin

Returns the operating system global notification center.

Distributed
Handle

Handle (pointer) to the unmanaged object representation.

Local

Returns the application local notification center.

Methods

AddObserver(String, INativeObject, Action<String,NSDictionary>, CFNotificationSuspensionBehavior)

Adds an observer to the notification center.

Dispose()

Releases the resources used by the CFNotificationCenter object.

Dispose(Boolean)

Releases the resources used by the CFNotificationCenter object.

Finalize()

Finalizer for the CFNotificationCenter object

PostNotification(String, INativeObject, NSDictionary, Boolean, Boolean)
RemoveEveryObserver()
RemoveObserver(CFNotificationObserverToken)

Removes the specified observer.

Applies to