Class AbstractHandler
Base class for handler classes
public abstract class AbstractHandler
- Inheritance
-
objectAbstractHandler
- Derived
- Extension Methods
Properties
ControlRecursion
If true, the recursion control is enabled on this handler.
public bool ControlRecursion { get; set; }
Property Value
- bool
IsStatic
True, if the handler is a static handler
[Obsolete("Property is deprecated and will be removed.")]
[ObsoleteSince(29, 3)]
public bool IsStatic { get; set; }
Property Value
- bool
Name
Event name. The name serves to uniquely identify the handler.
public string Name { get; set; }
Property Value
- string
OneTime
If true, this event can be executed only once. If the event was already executed, and new handler is added, it executes immediately.
public bool OneTime { get; set; }
Property Value
- bool
WasExecuted
Returns true if the event was already executed
public bool WasExecuted { get; }
Property Value
- bool
Methods
AddEvent<THandler>(ref List<THandler>, THandler)
Adds the event to the list
protected void AddEvent<THandler>(ref List<THandler> list, THandler h)
Parameters
list
List<THandler>List of events
h
THandlerEvent to add
Type Parameters
THandler
AssignCurrentHandler(EventArgs)
Assigns the current handler to the event arguments
protected void AssignCurrentHandler(EventArgs e)
Parameters
e
EventArgsEvent arguments
CheckBase(string)
Checks if the handler is base handler instance, and fires an exception if not
[Obsolete("Method is no longer used by the system and will be removed.")]
[ObsoleteSince(30, 2)]
protected void CheckBase(string member)
Parameters
member
stringMember that is called
CheckEvent(string)
Checks if the handler is event handler instance, and fires an exception if not
[Obsolete("Method is no longer used by the system and will be removed.")]
[ObsoleteSince(30, 2)]
protected void CheckEvent(string member)
Parameters
member
stringMember that is called
Clear()
Clears all bound event handlers from the event and resets the number of executions of the event
public virtual void Clear()
CountExecution()
Counts the execution of the event
protected void CountExecution()
Dispose()
Disposes the object
public virtual void Dispose()
Raise<TArgs>(string, List<EventHandler<TArgs>>, TArgs, bool)
Raises the list of events
protected void Raise<TArgs>(string partName, List<EventHandler<TArgs>> list, TArgs e, bool important = false) where TArgs : EventArgs
Parameters
partName
stringName of the part executing the handler
list
List<EventHandler<TArgs>>List of events to raise
e
TArgsEvent arguments
important
boolIf true, the event if considered important
Type Parameters
TArgs
RemoveEvent<THandler>(ref List<THandler>, THandler)
Removes the event from the list
protected void RemoveEvent<THandler>(ref List<THandler> list, THandler h)
Parameters
list
List<THandler>List of events
h
THandlerEvent to remove
Type Parameters
THandler
Reset()
Resets the number of executions of the event
public virtual void Reset()
SetParent(AbstractHandler)
Sets the parent event of the event
public abstract void SetParent(AbstractHandler parent)
Parameters
parent
AbstractHandlerNew parent event