T
- The EventArgs instance or subclass to use with this event.public class Event<T extends EventArgs>
extends java.lang.Object
Constructor and Description |
---|
Event()
Creates a new instance of this Object.
|
Modifier and Type | Method and Description |
---|---|
void |
addHandler(EventHandler<T> handler)
Adds a handler for this event
|
boolean |
hasHandlers()
Use this to determine whether you can actually raise the event,
since if the list is empty, you'll get an InvalidOperationException.
|
void |
raise(java.lang.Object sender,
T e)
Raises the event.
|
void |
removeHandler(EventHandler<T> handler)
Removes the specified handler for this event
|
public boolean hasHandlers()
public void addHandler(EventHandler<T> handler)
handler
- The handler to add to this event.public void removeHandler(EventHandler<T> handler)
handler
- InvalidOperationException
- Thrown when no event handlers have previously been assigned.public void raise(java.lang.Object sender, T e)
sender
- The Object that raised the event.e
- An instance of System.EventArgs that provides information about the event.InvalidOperationException
- Thrown when the event is raised with no event handlers assigned.