Interface IEventAggregator
Defines an object that channels events from multiple objects into a single object to simplify registration for clients.
Namespace: Umbraco.Cms.Core.Events
Assembly: Umbraco.Core.dll
Syntax
public interface IEventAggregatorMethods
View SourcePublish<TNotification>(TNotification)
Synchronously send a notification to multiple handlers of both sync and async.
Declaration
void Publish<TNotification>(TNotification notification)
    where TNotification : INotificationParameters
| Type | Name | Description | 
|---|---|---|
| TNotification | notification | The notification object. | 
Type Parameters
| Name | Description | 
|---|---|
| TNotification | The type of notification being handled. | 
Publish<TNotification, TNotificationHandler>(IEnumerable<TNotification>)
Synchronously send a notifications to multiple handlers of both sync and async.
Declaration
void Publish<TNotification, TNotificationHandler>(IEnumerable<TNotification> notifications)
    where TNotification : INotification where TNotificationHandler : INotificationHandlerParameters
| Type | Name | Description | 
|---|---|---|
| IEnumerable<TNotification> | notifications | The notification objects. | 
Type Parameters
| Name | Description | 
|---|---|
| TNotification | The type of notification being handled. | 
| TNotificationHandler | The type of the notification handler. | 
PublishAsync<TNotification>(TNotification, CancellationToken)
Asynchronously send a notification to multiple handlers of both sync and async.
Declaration
Task PublishAsync<TNotification>(TNotification notification, CancellationToken cancellationToken = null)
    where TNotification : INotificationParameters
| Type | Name | Description | 
|---|---|---|
| TNotification | notification | The notification object. | 
| CancellationToken | cancellationToken | An optional cancellation token. | 
Returns
| Type | Description | 
|---|---|
| Task | A task that represents the publish operation. | 
Type Parameters
| Name | Description | 
|---|---|
| TNotification | The type of notification being handled. | 
PublishAsync<TNotification, TNotificationHandler>(IEnumerable<TNotification>, CancellationToken)
Asynchronously send a notifications to multiple handlers of both sync and async.
Declaration
Task PublishAsync<TNotification, TNotificationHandler>(IEnumerable<TNotification> notifications, CancellationToken cancellationToken = null)
    where TNotification : INotification where TNotificationHandler : INotificationHandlerParameters
| Type | Name | Description | 
|---|---|---|
| IEnumerable<TNotification> | notifications | The notification objects. | 
| CancellationToken | cancellationToken | An optional cancellation token. | 
Returns
| Type | Description | 
|---|---|
| Task | A task that represents the publish operation. | 
Type Parameters
| Name | Description | 
|---|---|
| TNotification | The type of notification being handled. | 
| TNotificationHandler | The type of the notification handler. | 
PublishCancelable<TCancelableNotification>(TCancelableNotification)
Publishes a cancelable notification to the notification subscribers.
Declaration
bool PublishCancelable<TCancelableNotification>(TCancelableNotification notification)
    where TCancelableNotification : ICancelableNotificationParameters
| Type | Name | Description | 
|---|---|---|
| TCancelableNotification | notification | The notification. | 
Returns
| Type | Description | 
|---|---|
| System.Boolean | 
 | 
Type Parameters
| Name | Description | 
|---|---|
| TCancelableNotification | The type of notification being handled. | 
PublishCancelableAsync<TCancelableNotification>(TCancelableNotification)
Publishes a cancelable notification async to the notification subscribers.
Declaration
Task<bool> PublishCancelableAsync<TCancelableNotification>(TCancelableNotification notification)
    where TCancelableNotification : ICancelableNotificationParameters
| Type | Name | Description | 
|---|---|---|
| TCancelableNotification | notification | The notification. | 
Returns
| Type | Description | 
|---|---|
| Task<System.Boolean> | 
 | 
Type Parameters
| Name | Description | 
|---|---|
| TCancelableNotification | The type of notification being handled. |