View Source
Class CancellableEventArgs
Represents event data for events that support cancellation.
Inheritance
object
EventArgs
Assembly: Umbraco.Core.dll
Syntax
public class CancellableEventArgs : EventArgs
Constructors
View Source
CancellableEventArgs()
Declaration
public CancellableEventArgs()
View Source
CancellableEventArgs(bool)
Declaration
public CancellableEventArgs(bool canCancel)
Parameters
| Type |
Name |
Description |
| bool |
canCancel |
|
View Source
CancellableEventArgs(bool, EventMessages)
Declaration
public CancellableEventArgs(bool canCancel, EventMessages eventMessages)
Parameters
View Source
CancellableEventArgs(bool, EventMessages, IDictionary<string, object>)
Declaration
public CancellableEventArgs(bool canCancel, EventMessages messages, IDictionary<string, object> additionalData)
Parameters
| Type |
Name |
Description |
| bool |
canCancel |
|
| EventMessages |
messages |
|
| IDictionary<string, object> |
additionalData |
|
View Source
CancellableEventArgs(EventMessages)
Declaration
public CancellableEventArgs(EventMessages eventMessages)
Parameters
Properties
View Source
AdditionalData
In some cases raised evens might need to contain additional arbitrary readonly data which can be read by event
subscribers
Declaration
public ReadOnlyDictionary<string, object> AdditionalData { get; set; }
Property Value
| Type |
Description |
| ReadOnlyDictionary<string, object> |
|
View Source
CanCancel
Flag to determine if this instance will support being cancellable
Declaration
public bool CanCancel { get; set; }
Property Value
View Source
Cancel
If this instance supports cancellation, this gets/sets the cancel value
Declaration
public bool Cancel { get; set; }
Property Value
View Source
EventState
This can be used by event subscribers to store state in the event args so they easily deal with custom state data
between a starting ("ing")
event and an ending ("ed") event
Declaration
public IDictionary<string, object> EventState { get; set; }
Property Value
| Type |
Description |
| IDictionary<string, object> |
|
View Source
Messages
Returns the EventMessages object which is used to add messages to the message collection for this event
Declaration
public EventMessages Messages { get; }
Property Value
Methods
View Source
CancelOperation(EventMessage)
if this instance supports cancellation, this will set Cancel to true with an affiliated cancellation message
Declaration
public void CancelOperation(EventMessage cancelationMessage)
Parameters
View Source
Equals(object?)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object? obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
The object to compare with the current object.
|
Returns
| Type |
Description |
| bool |
true if the specified object is equal to the current object; otherwise, false.
|
View Source
Equals(CancellableEventArgs?)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(CancellableEventArgs? other)
Parameters
Returns
| Type |
Description |
| bool |
true if the current object is equal to the other parameter; otherwise, false.
|
View Source
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| int |
A hash code for the current object.
|
Operators
View Source
operator ==(CancellableEventArgs?, CancellableEventArgs?)
Declaration
public static bool operator ==(CancellableEventArgs? left, CancellableEventArgs? right)
Parameters
Returns
View Source
operator !=(CancellableEventArgs, CancellableEventArgs)
Declaration
public static bool operator !=(CancellableEventArgs left, CancellableEventArgs right)
Parameters
Returns