Search Results for

    Show / Hide Table of Contents
    View Source

    Class ScopedNotificationPublisher<TNotificationHandler>

    Implementation of IScopedNotificationPublisher that publishes notifications within a scope for a specific handler type.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core.Events
    Assembly: Umbraco.Core.dll
    Syntax
    public class ScopedNotificationPublisher<TNotificationHandler> : IScopedNotificationPublisher where TNotificationHandler : INotificationHandler
    Type Parameters
    Name Description
    TNotificationHandler

    The type of notification handler.

    Constructors

    View Source

    ScopedNotificationPublisher(IEventAggregator, bool)

    Initializes a new instance of the ScopedNotificationPublisher<TNotificationHandler> class.

    Declaration
    public ScopedNotificationPublisher(IEventAggregator eventAggregator, bool publishCancelableNotificationOnScopeExit = false)
    Parameters
    Type Name Description
    IEventAggregator eventAggregator

    The event aggregator.

    bool publishCancelableNotificationOnScopeExit

    A value indicating whether cancelable notifications should be published on scope exit.

    Methods

    View Source

    Publish(INotification)

    Publishes a notification to the notification subscribers

    Declaration
    public void Publish(INotification notification)
    Parameters
    Type Name Description
    INotification notification
    Remarks

    The notification is published upon successful completion of the current scope, i.e. when things have been saved/published/deleted etc.

    View Source

    PublishCancelable(ICancelableNotification)

    Publishes a cancelable notification to the notification subscribers

    Declaration
    public bool PublishCancelable(ICancelableNotification notification)
    Parameters
    Type Name Description
    ICancelableNotification notification
    Returns
    Type Description
    bool

    True if the notification was cancelled by a subscriber, false otherwise

    View Source

    PublishCancelableAsync(ICancelableNotification)

    Publishes a cancelable notification to the notification subscribers

    Declaration
    public Task<bool> PublishCancelableAsync(ICancelableNotification notification)
    Parameters
    Type Name Description
    ICancelableNotification notification
    Returns
    Type Description
    Task<bool>

    True if the notification was cancelled by a subscriber, false otherwise

    View Source

    PublishScopedNotifications(IList<INotification>)

    Publishes all pending scoped notifications.

    Declaration
    protected virtual void PublishScopedNotifications(IList<INotification> notifications)
    Parameters
    Type Name Description
    IList<INotification> notifications

    The notifications to publish.

    View Source

    ScopeExit(bool)

    Invokes publishing of all pending notifications within the current scope

    Declaration
    public void ScopeExit(bool completed)
    Parameters
    Type Name Description
    bool completed
    View Source

    Suppress()

    Suppresses all notifications from being added/created until the result object is disposed.

    Declaration
    public IDisposable Suppress()
    Returns
    Type Description
    IDisposable
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX