Dawn of Light - Class documentation 2900
This is the Dawn of Light project
DOL.Events.DOLEventHandlerCollection Class Reference

This class represents a collection of event handlers. You can add and remove handlers from this list and fire events with parameters which will be routed through all handlers. More...

List of all members.

Public Member Functions

WeakMulticastDelegate GetEventDelegate (DOLEvent e)
 DOLEventHandlerCollection ()
 Constructs a new DOLEventHandler collection.
void AddHandler (DOLEvent e, DOLEventHandler del)
 Adds an event handler to the list.
void AddHandlerUnique (DOLEvent e, DOLEventHandler del)
 Adds an event handler to the list, if it's already added do nothing.
void RemoveHandler (DOLEvent e, DOLEventHandler del)
 Removes an event handler from the list.
void RemoveAllHandlers (DOLEvent e)
 Removes all callback handlers for a given event.
void RemoveAllHandlers ()
 Removes all event handlers.
void Notify (DOLEvent e)
 Notifies all registered event handlers of the occurance of an event!
void Notify (DOLEvent e, object sender)
 Notifies all registered event handlers of the occurance of an event!
void Notify (DOLEvent e, EventArgs args)
 Notifies all registered event handlers of the occurance of an event!
void Notify (DOLEvent e, object sender, EventArgs eArgs)
 Notifies all registered event handlers of the occurance of an event!

Properties

int Count [get]

Detailed Description

This class represents a collection of event handlers. You can add and remove handlers from this list and fire events with parameters which will be routed through all handlers.

This class is lazy initialized, meaning as long as you don't add any handlers, the memory usage will be very low!


Constructor & Destructor Documentation

DOL.Events.DOLEventHandlerCollection.DOLEventHandlerCollection ( )

Constructs a new DOLEventHandler collection.


Member Function Documentation

void DOL.Events.DOLEventHandlerCollection.AddHandler ( DOLEvent  e,
DOLEventHandler  del 
)

Adds an event handler to the list.

Parameters:
eThe event from which we add a handler
delThe callback method
void DOL.Events.DOLEventHandlerCollection.AddHandlerUnique ( DOLEvent  e,
DOLEventHandler  del 
)

Adds an event handler to the list, if it's already added do nothing.

Parameters:
eThe event from which we add a handler
delThe callback method
void DOL.Events.DOLEventHandlerCollection.Notify ( DOLEvent  e,
EventArgs  args 
)

Notifies all registered event handlers of the occurance of an event!

Parameters:
eThe event that occured
argsThe event arguments
void DOL.Events.DOLEventHandlerCollection.Notify ( DOLEvent  e,
object  sender 
)

Notifies all registered event handlers of the occurance of an event!

Parameters:
eThe event that occured
senderThe sender of this event
void DOL.Events.DOLEventHandlerCollection.Notify ( DOLEvent  e,
object  sender,
EventArgs  eArgs 
)

Notifies all registered event handlers of the occurance of an event!

Parameters:
eThe event that occured
senderThe sender of this event
eArgsThe event arguments

Overwrite the EventArgs class to set own arguments

void DOL.Events.DOLEventHandlerCollection.Notify ( DOLEvent  e)

Notifies all registered event handlers of the occurance of an event!

Parameters:
eThe event that occured
void DOL.Events.DOLEventHandlerCollection.RemoveAllHandlers ( )

Removes all event handlers.

void DOL.Events.DOLEventHandlerCollection.RemoveAllHandlers ( DOLEvent  e)

Removes all callback handlers for a given event.

Parameters:
eThe event from which to remove all handlers
void DOL.Events.DOLEventHandlerCollection.RemoveHandler ( DOLEvent  e,
DOLEventHandler  del 
)

Removes an event handler from the list.

Parameters:
eThe event from which to remove the handler
delThe callback method to remove

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties Events