Class CancelableNotification
Base class for notifications that can be canceled by a notification handler.
Namespace: Umbraco.Cms.Core.Notifications
Assembly: Umbraco.Core.dll
Syntax
public class CancelableNotification : StatefulNotification, IStatefulNotification, ICancelableNotification, INotification
Remarks
Notification handlers can set Cancel to true or call CancelOperation(EventMessage)
to abort the operation that triggered the notification.
Constructors
View SourceCancelableNotification(EventMessages)
Initializes a new instance of the CancelableNotification class.
Declaration
public CancelableNotification(EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| EventMessages | messages | The event messages collection for adding cancellation messages. |
Properties
View SourceCancel
Gets or sets a value indicating whether the operation should be canceled.
Declaration
public bool Cancel { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Messages
Gets the event messages collection associated with this notification.
Declaration
public EventMessages Messages { get; }
Property Value
| Type | Description |
|---|---|
| EventMessages |
Methods
View SourceCancelOperation(EventMessage)
Cancels the operation and adds a cancellation message to the event messages collection.
Declaration
public void CancelOperation(EventMessage cancellationMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| EventMessage | cancellationMessage | The message explaining why the operation was canceled. |