Search Results for

    Show / Hide Table of Contents
    View Source

    Class EventAggregator

    Defines an object that channels events from multiple objects into a single object to simplify registration for clients.

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Core.Events
    Assembly: Umbraco.Core.dll
    Syntax
    public class EventAggregator : IEventAggregator

    Constructors

    View Source

    EventAggregator(ServiceFactory)

    Initializes a new instance of the EventAggregator class.

    Declaration
    public EventAggregator(ServiceFactory serviceFactory)
    Parameters
    Type Name Description
    ServiceFactory serviceFactory

    The service instance factory.

    Methods

    View Source

    Publish<TNotification>(TNotification)

    Synchronously send a notification to multiple handlers of both sync and async

    Declaration
    public void Publish<TNotification>(TNotification notification)
        where TNotification : INotification
    Parameters
    Type Name Description
    TNotification notification

    The notification object.

    Type Parameters
    Name Description
    TNotification

    The type of notification being handled.

    View Source

    PublishAsync<TNotification>(TNotification, CancellationToken)

    Asynchronously send a notification to multiple handlers of both sync and async

    Declaration
    public async Task PublishAsync<TNotification>(TNotification notification, CancellationToken cancellationToken = null)
        where TNotification : INotification
    Parameters
    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.

    View Source

    PublishCancelable<TCancelableNotification>(TCancelableNotification)

    Declaration
    public bool PublishCancelable<TCancelableNotification>(TCancelableNotification notification)
        where TCancelableNotification : ICancelableNotification
    Parameters
    Type Name Description
    TCancelableNotification notification
    Returns
    Type Description
    System.Boolean
    Type Parameters
    Name Description
    TCancelableNotification
    View Source

    PublishCancelableAsync<TCancelableNotification>(TCancelableNotification)

    Declaration
    public async Task<bool> PublishCancelableAsync<TCancelableNotification>(TCancelableNotification notification)
        where TCancelableNotification : ICancelableNotification
    Parameters
    Type Name Description
    TCancelableNotification notification
    Returns
    Type Description
    Task<System.Boolean>
    Type Parameters
    Name Description
    TCancelableNotification
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • EventAggregator(ServiceFactory)
    • Methods
      • Publish<TNotification>(TNotification)
      • PublishAsync<TNotification>(TNotification, CancellationToken)
      • PublishCancelable<TCancelableNotification>(TCancelableNotification)
      • PublishCancelableAsync<TCancelableNotification>(TCancelableNotification)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX