Class CancelableObjectNotification<T>
Abstract base class for cancelable notifications that carry a target object.
Namespace: Umbraco.Cms.Core.Notifications
Assembly: Umbraco.Core.dll
Syntax
public abstract class CancelableObjectNotification<T> : ObjectNotification<T>, IStatefulNotification, ICancelableNotification, INotification where T : class
Type Parameters
| Name | Description |
|---|---|
| T | The type of the target object associated with this notification. |
Remarks
This class combines the functionality of ObjectNotification<T> and ICancelableNotification, allowing handlers to both access the target object and cancel the operation if needed.
Constructors
View SourceCancelableObjectNotification(T, EventMessages)
Initializes a new instance of the CancelableObjectNotification<T> class.
Declaration
protected CancelableObjectNotification(T target, EventMessages messages)
Parameters
| Type | Name | Description |
|---|---|---|
| T | target | The target object associated with this notification. |
| EventMessages | messages | The event messages collection. |
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 |
|
Methods
View SourceCancelOperation(EventMessage)
Cancels the operation and adds a cancellation message to the event messages collection.
Declaration
public void CancelOperation(EventMessage cancelationMessage)
Parameters
| Type | Name | Description |
|---|---|---|
| EventMessage | cancelationMessage | The message explaining why the operation was canceled. |