Share via


CFNotificationCenter Class

Definition

Notification hub for the application.

public class CFNotificationCenter : CoreFoundation.NativeObject
type CFNotificationCenter = class
    inherit NativeObject
Inheritance
CFNotificationCenter

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

Name Description
Darwin

Returns the operating system global notification center.

Distributed
Handle (Inherited from DisposableObject)
Local

Returns the application local notification center.

Owns (Inherited from DisposableObject)

Methods

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

Adds an observer to the notification center.

ClearHandle() (Inherited from DisposableObject)
Dispose() (Inherited from DisposableObject)
Dispose(Boolean) (Inherited from NativeObject)
Equals(Object) (Inherited from DisposableObject)
GetCheckedHandle() (Inherited from DisposableObject)
GetHashCode() (Inherited from DisposableObject)
InitializeHandle(NativeHandle) (Inherited from DisposableObject)
PostNotification(String, INativeObject, NSDictionary, Boolean, Boolean)
Release() (Inherited from NativeObject)
RemoveEveryObserver()
RemoveObserver(CFNotificationObserverToken)

Removes the specified observer.

Retain() (Inherited from NativeObject)

Extension Methods

Name Description
GetHandle(INativeObject)
GetNonNullHandle(INativeObject, String)

Applies to