// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.Threading.Tasks;
using Umbraco.Cms.Core.Notifications;
namespace Umbraco.Cms.Core.Events
{
public interface IScopedNotificationPublisher
{
///
/// Suppresses all notifications from being added/created until the result object is disposed.
///
///
IDisposable Suppress();
///
/// Publishes a cancelable notification to the notification subscribers
///
///
/// True if the notification was cancelled by a subscriber, false otherwise
bool PublishCancelable(ICancelableNotification notification);
///
/// Publishes a cancelable notification to the notification subscribers
///
///
/// True if the notification was cancelled by a subscriber, false otherwise
Task PublishCancelableAsync(ICancelableNotification notification);
///
/// Publishes a notification to the notification subscribers
///
///
/// The notification is published upon successful completion of the current scope, i.e. when things have been saved/published/deleted etc.
void Publish(INotification notification);
///
/// Invokes publishing of all pending notifications within the current scope
///
///
void ScopeExit(bool completed);
}
}