Table of Contents

Class CallbackEventHandler

Namespace
Ceres.Events
Assembly
Ceres.dll

Interface for classes capable of having callbacks to handle events.

public abstract class CallbackEventHandler : IEventHandler
Inheritance
CallbackEventHandler
Implements
Derived
Inherited Members
Extension Methods

Constructors

CallbackEventHandler()

protected CallbackEventHandler()

Properties

Coordinator

public abstract IEventCoordinator Coordinator { get; }

Property Value

IEventCoordinator

IsCompositeRoot

public virtual bool IsCompositeRoot { get; }

Property Value

bool

Parent

Get and set parent callBack handler

public CallbackEventHandler Parent { get; set; }

Property Value

CallbackEventHandler

Methods

ExecuteDefaultAction(EventBase)

Executes logic after the callbacks registered on the event target have executed, unless the event has been marked to prevent its default behaviour. PreventDefault().

protected virtual void ExecuteDefaultAction(EventBase evt)

Parameters

evt EventBase

The event instance.

Remarks

This method is designed to be overridden by subclasses. Use it to implement event handling without registering callbacks which guarantees precedences of callbacks registered by users of the subclass. Unlike ExecuteDefaultActionAtTarget(EventBase), this method is called after the callbacks registered on the element

ExecuteDefaultActionAtTarget(EventBase)

Executes logic after the callbacks registered on the event target have executed, unless the event is marked to prevent its default behaviour. PreventDefault().

protected virtual void ExecuteDefaultActionAtTarget(EventBase evt)

Parameters

evt EventBase

The event instance.

ExecuteDefaultActionDisabled(EventBase)

protected virtual void ExecuteDefaultActionDisabled(EventBase evt)

Parameters

evt EventBase

ExecuteDefaultActionDisabledAtTarget(EventBase)

protected virtual void ExecuteDefaultActionDisabledAtTarget(EventBase evt)

Parameters

evt EventBase

HandleEventAtCurrentTargetAndPhase(EventBase)

public void HandleEventAtCurrentTargetAndPhase(EventBase evt)

Parameters

evt EventBase

HandleEventAtTargetAndDefaultPhase(EventBase)

public void HandleEventAtTargetAndDefaultPhase(EventBase evt)

Parameters

evt EventBase

HandleEventAtTargetPhase(EventBase)

public void HandleEventAtTargetPhase(EventBase evt)

Parameters

evt EventBase

HasBubbleUpHandlers()

Return true if event handlers for the event propagation BubbleUp phase have been attached on this object.

public bool HasBubbleUpHandlers()

Returns

bool

True if object has event handlers for the BubbleUp phase.

HasTrickleDownHandlers()

Returns true if event handlers, for the event propagation TrickleDown phase, are attached to this object.

public bool HasTrickleDownHandlers()

Returns

bool

True if object has event handlers for the TrickleDown phase.

RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)

Adds an event handler to the instance. If the event handler has already been registered for the same phase (either TrickleDown or BubbleUp) then this method has no effect.

public void RegisterCallback<TEventType>(EventCallback<TEventType> callback, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase<TEventType>, new()

Parameters

callback EventCallback<TEventType>

The event handler to add.

useTrickleDown TrickleDown

Type Parameters

TEventType

RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)

Adds an event handler to the instance. If the event handler has already been registered for the same phase then this method has no effect.

public void RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType> callback, TUserArgsType userArgs, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase<TEventType>, new()

Parameters

callback EventCallback<TEventType, TUserArgsType>

The event handler to add.

userArgs TUserArgsType

Data to pass to the callback.

useTrickleDown TrickleDown

Type Parameters

TEventType
TUserArgsType

SendEvent(EventBase, DispatchMode)

Sends an event to the event handler.

public abstract void SendEvent(EventBase e, DispatchMode dispatchMode = DispatchMode.Default)

Parameters

e EventBase

The event to send.

dispatchMode DispatchMode

The event dispatch mode.

UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)

Remove callback from the instance.

public void UnregisterCallback<TEventType>(EventCallback<TEventType> callback, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase<TEventType>, new()

Parameters

callback EventCallback<TEventType>

The callback to remove. If this callback was never registered, nothing happens.

useTrickleDown TrickleDown

Set this parameter to true to remove the callback from the TrickleDown phase. Set this parameter to false to remove the callback from the BubbleUp phase.

Type Parameters

TEventType

UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)

Remove callback from the instance.

public void UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType> callback, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase<TEventType>, new()

Parameters

callback EventCallback<TEventType, TUserArgsType>

The callback to remove. If this callback was never registered, nothing happens.

useTrickleDown TrickleDown

Set this parameter to true to remove the callback from the TrickleDown phase. Set this parameter to false to remove the callback from the BubbleUp phase.

Type Parameters

TEventType
TUserArgsType