Class CancellableEventArgs
Event args for that can support cancellation
Inheritance
System.Object
System.EventArgs
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
[HostProtection(SecurityAction.LinkDemand, SharedState = true)]
public class CancellableEventArgs : EventArgs, IEquatable<CancellableEventArgs>
Constructors
CancellableEventArgs()
Declaration
public CancellableEventArgs()
CancellableEventArgs(Boolean)
Declaration
public CancellableEventArgs(bool canCancel)
Parameters
Type |
Name |
Description |
System.Boolean |
canCancel |
|
CancellableEventArgs(Boolean, EventMessages)
Declaration
public CancellableEventArgs(bool canCancel, EventMessages eventMessages)
Parameters
Type |
Name |
Description |
System.Boolean |
canCancel |
|
EventMessages |
eventMessages |
|
CancellableEventArgs(Boolean, EventMessages, IDictionary<String, Object>)
Declaration
public CancellableEventArgs(bool canCancel, EventMessages messages, IDictionary<string, object> additionalData)
Parameters
Type |
Name |
Description |
System.Boolean |
canCancel |
|
EventMessages |
messages |
|
System.Collections.Generic.IDictionary<System.String, System.Object> |
additionalData |
|
CancellableEventArgs(EventMessages)
Declaration
public CancellableEventArgs(EventMessages eventMessages)
Parameters
Properties
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; }
Property Value
Type |
Description |
System.Collections.ObjectModel.ReadOnlyDictionary<System.String, System.Object> |
|
CanCancel
Flag to determine if this instance will support being cancellable
Declaration
public bool CanCancel { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Cancel
If this instance supports cancellation, this gets/sets the cancel value
Declaration
public bool Cancel { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
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; }
Property Value
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
|
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
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
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Equals(CancellableEventArgs)
Declaration
public bool Equals(CancellableEventArgs other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Operators
Equality(CancellableEventArgs, CancellableEventArgs)
Declaration
public static bool operator ==(CancellableEventArgs left, CancellableEventArgs right)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(CancellableEventArgs, CancellableEventArgs)
Declaration
public static bool operator !=(CancellableEventArgs left, CancellableEventArgs right)
Parameters
Returns
Type |
Description |
System.Boolean |
|