Class CallbackEventHandler
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
IsCompositeRoot
public virtual bool IsCompositeRoot { get; }
Property Value
Parent
Get and set parent callBack handler
public CallbackEventHandler Parent { get; set; }
Property Value
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
evtEventBaseThe 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
evtEventBaseThe event instance.
ExecuteDefaultActionDisabled(EventBase)
protected virtual void ExecuteDefaultActionDisabled(EventBase evt)
Parameters
evtEventBase
ExecuteDefaultActionDisabledAtTarget(EventBase)
protected virtual void ExecuteDefaultActionDisabledAtTarget(EventBase evt)
Parameters
evtEventBase
HandleEventAtCurrentTargetAndPhase(EventBase)
public void HandleEventAtCurrentTargetAndPhase(EventBase evt)
Parameters
evtEventBase
HandleEventAtTargetAndDefaultPhase(EventBase)
public void HandleEventAtTargetAndDefaultPhase(EventBase evt)
Parameters
evtEventBase
HandleEventAtTargetPhase(EventBase)
public void HandleEventAtTargetPhase(EventBase evt)
Parameters
evtEventBase
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
callbackEventCallback<TEventType>The event handler to add.
useTrickleDownTrickleDown
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
callbackEventCallback<TEventType, TUserArgsType>The event handler to add.
userArgsTUserArgsTypeData to pass to the callback.
useTrickleDownTrickleDown
Type Parameters
TEventTypeTUserArgsType
SendEvent(EventBase, DispatchMode)
Sends an event to the event handler.
public abstract void SendEvent(EventBase e, DispatchMode dispatchMode = DispatchMode.Default)
Parameters
eEventBaseThe event to send.
dispatchModeDispatchModeThe 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
callbackEventCallback<TEventType>The callback to remove. If this callback was never registered, nothing happens.
useTrickleDownTrickleDownSet 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
callbackEventCallback<TEventType, TUserArgsType>The callback to remove. If this callback was never registered, nothing happens.
useTrickleDownTrickleDownSet 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
TEventTypeTUserArgsType