Class EventExtensions
Extension methods for cancellable event operations
Inheritance
System.Object
Namespace: Umbraco.Core.Events
Assembly: Umbraco.Core.dll
Syntax
public static class EventExtensions
Methods
View SourceIsRaisedEventCancelled<TSender, TArgs>(TypedEventHandler<TSender, TArgs>, TArgs, TSender)
Raises a cancelable event and returns a value indicating whether the event should be cancelled.
Declaration
public static bool IsRaisedEventCancelled<TSender, TArgs>(this TypedEventHandler<TSender, TArgs> eventHandler, TArgs args, TSender sender)
where TArgs : CancellableEventArgs
Parameters
Type | Name | Description |
---|---|---|
TypedEventHandler<TSender, TArgs> | eventHandler | The event handler. |
TArgs | args | The event source. |
TSender | sender | The event data. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the cancelable event should be cancelled |
Type Parameters
Name | Description |
---|---|
TSender | The type of the event source. |
TArgs | The type of the event data. |
Remarks
A cancelable event is raised by a component when it is about to perform an action that can be canceled.
RaiseEvent<TSender, TArgs>(TypedEventHandler<TSender, TArgs>, TArgs, TSender)
Raises an event.
Declaration
public static void RaiseEvent<TSender, TArgs>(this TypedEventHandler<TSender, TArgs> eventHandler, TArgs args, TSender sender)
where TArgs : EventArgs
Parameters
Type | Name | Description |
---|---|---|
TypedEventHandler<TSender, TArgs> | eventHandler | The event handler. |
TArgs | args | The event source. |
TSender | sender | The event data. |
Type Parameters
Name | Description |
---|---|
TSender | The type of the event source. |
TArgs | The type of the event data. |