Click or drag to resize

Event Class

A simple event handler that supports using both interface and delegate listeners. This is the parameterless version. See EventT if you need to send data with the event. Interface listeners are required to implement the IEventListener interface. Events are differentiated by an integer. You are expected to create constants to define your events and make them unique.
Inheritance Hierarchy
SystemObject
  Archon.SwissArmyLib.EventsEvent

Namespace:  Archon.SwissArmyLib.Events
Assembly:  Archon.SwissArmyLib (in Archon.SwissArmyLib.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class Event
Request Example View Source

The Event type exposes the following members.

Constructors
  NameDescription
Public methodEvent(Int32)
Creates a new Event with the specified ID.
Public methodEvent(Int32, Int32)
Creates a new Event with the specified ID and initial listener capacity.
Top
Properties
  NameDescription
Public propertyId
Gets the ID of this event.
Public propertyListeners
Gets a readonly collection of current listeners.
Public propertySuppressExceptions
Gets or sets whether listener exceptions should be logged.
Top
Methods
  NameDescription
Public methodAddListener(Action, Int32)
Adds a listener for the event with an optional call-order priority.
Public methodAddListener(IEventListener, Int32)
Adds a listener for the event with an optional call-order priority.
Public methodClear
Clears all listeners
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodHasListener(Action)
Checks whether the specified listener is currently listening to this event.
Public methodHasListener(IEventListener)
Checks whether the specified listener is currently listening to this event.
Public methodInvoke
Notifies all listeners that the event occured.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemoveListener(Action)
Removes a listener from the event.
Public methodRemoveListener(IEventListener)
Removes a listener from the event.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
See Also