Class EventBase
The base class for all events. The class implements IDisposable to ensure proper release of the event from the pool and of any unmanaged resources, when necessary.
public abstract class EventBase : IDisposable
- Inheritance
-
EventBase
- Implements
- Derived
- Inherited Members
- Extension Methods
Remarks
Ported from EventBase.
Constructors
EventBase()
Constructor. Avoid creating new event instances. Instead, use GetPooled() to get an instance from a pool of reusable event instances.
protected EventBase()
Properties
Bubbles
Returns whether this event type bubbles up in the event propagation path.
public bool Bubbles { get; protected set; }
Property Value
CurrentTarget
The current target of the event. This is the eventHandler, in the propagation path, for which event handlers are currently being executed.
public virtual IEventHandler CurrentTarget { get; }
Property Value
Dispatch
Indicates whether the event is being dispatched to a eventHandler. An event cannot be re-dispatched while it being dispatched. If you need to recursively dispatch an event, it is recommended that you use a copy of the event.
public bool Dispatch { get; }
Property Value
EventTypeId
Retrieves the type ID for this event instance.
public virtual long EventTypeId { get; }
Property Value
IsDefaultPrevented
Returns true if the default actions should not be executed for this event.
public bool IsDefaultPrevented { get; }
Property Value
IsImmediatePropagationStopped
Indicates whether StopImmediatePropagation() was called for this event.
public bool IsImmediatePropagationStopped { get; }
Property Value
IsPropagationStopped
Whether StopPropagation() was called for this event.
public bool IsPropagationStopped { get; }
Property Value
Pooled
Whether the event is allocated from a pool of events.
protected bool Pooled { get; set; }
Property Value
Propagation
public EventBase.EventPropagation Propagation { get; protected set; }
Property Value
PropagationPhase
The current propagation phase for this event.
public PropagationPhase PropagationPhase { get; }
Property Value
StopDispatch
public bool StopDispatch { get; set; }
Property Value
Target
The target handler that received this event. Unlike currentTarget, this target does not change when the event is sent to other elements along the propagation path.
public IEventHandler Target { get; set; }
Property Value
Timestamp
The time when the event was created, in milliseconds.
public long Timestamp { get; }
Property Value
Remarks
This value is relative to the start time of the current application.
TricklesDown
Returns whether this event is sent down the event propagation path during the TrickleDown phase.
public bool TricklesDown { get; protected set; }
Property Value
Methods
Acquire()
public abstract void Acquire()
Dispose()
Implementation of IDisposable.
public abstract void Dispose()
Init()
Resets all event members to their initial values.
protected virtual void Init()
PostDispatch(IEventCoordinator)
Allows subclasses to perform custom logic after the event has been dispatched.
protected virtual void PostDispatch(IEventCoordinator coordinator)
Parameters
coordinatorIEventCoordinator
PreDispatch(IEventCoordinator)
Allows subclasses to perform custom logic before the event is dispatched.
protected virtual void PreDispatch(IEventCoordinator coordinator)
Parameters
coordinatorIEventCoordinator
PreventDefault()
Indicates whether the default actions are prevented from being executed for this event.
public void PreventDefault()
RegisterEventType()
Registers an event class to the event type system.
protected static long RegisterEventType()
Returns
- long
The type ID.
StopImmediatePropagation()
Immediately stops the propagation of the event. The event isn't sent to other elements along the propagation path. This method prevents other event handlers from executing on the current target.
public void StopImmediatePropagation()
StopPropagation()
Stops propagating this event. The event is not sent to other elements along the propagation path. This method does not prevent other event handlers from executing on the current target.
public void StopPropagation()
TimeSinceStartupMs()
public static long TimeSinceStartupMs()