Class EventDefinitionBase
Provides a base class for event definitions that can be tracked and raised by an event dispatcher.
Inheritance
Namespace: Umbraco.Cms.Core.Events
Assembly: Umbraco.Core.dll
Syntax
public abstract class EventDefinitionBase : IEventDefinition
Constructors
View SourceEventDefinitionBase(object?, object?, string?)
Initializes a new instance of the EventDefinitionBase class.
Declaration
protected EventDefinitionBase(object? sender, object? args, string? eventName = null)
Parameters
| Type | Name | Description |
|---|---|---|
| object | sender | The source of the event. |
| object | args | The event arguments. |
| string | eventName | The optional name of the event. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when |
| AmbiguousMatchException | Thrown when the event name cannot be automatically determined. |
Properties
View SourceArgs
Gets the event arguments.
Declaration
public object Args { get; }
Property Value
| Type | Description |
|---|---|
| object |
EventName
Gets the name of the event.
Declaration
public string? EventName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Sender
Gets the source of the event.
Declaration
public object Sender { get; }
Property Value
| Type | Description |
|---|---|
| object |
Methods
View SourceEquals(object?)
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
Returns
| Type | Description |
|---|---|
| bool |
Equals(EventDefinitionBase?)
Declaration
public bool Equals(EventDefinitionBase? other)
Parameters
| Type | Name | Description |
|---|---|---|
| EventDefinitionBase | other |
Returns
| Type | Description |
|---|---|
| bool |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
RaiseEvent()
Raises the event by invoking the tracked event handler.
Declaration
public abstract void RaiseEvent()
Operators
View Sourceoperator ==(EventDefinitionBase, EventDefinitionBase)
Determines whether two EventDefinitionBase instances are equal.
Declaration
public static bool operator ==(EventDefinitionBase left, EventDefinitionBase right)
Parameters
| Type | Name | Description |
|---|---|---|
| EventDefinitionBase | left | The first instance to compare. |
| EventDefinitionBase | right | The second instance to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
operator !=(EventDefinitionBase, EventDefinitionBase)
Determines whether two EventDefinitionBase instances are not equal.
Declaration
public static bool operator !=(EventDefinitionBase left, EventDefinitionBase right)
Parameters
| Type | Name | Description |
|---|---|---|
| EventDefinitionBase | left | The first instance to compare. |
| EventDefinitionBase | right | The second instance to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|