EventTarget Class

EventTarget class

The EventTarget interface is implemented by objects that can receive events and may have listeners for them. In other words, any target of events implements the three methods associated with this interface.

Element, and its children, as well as Document and Window, are the most common event targets, but other objects can be event targets, too.

public class EventTarget : DOMObject, IDisposable, IEventTarget

Constructors

NameDescription
EventTarget()Initializes a new instance of the EventTarget object.

Methods

NameDescription
AddEventListener(string, IEventListener)The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
AddEventListener(string, DOMEventHandler, bool)The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
AddEventListener(string, IEventListener, bool)The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
DispatchEvent(Event)Dispatches an Event at the specified EventTarget, (synchronously) invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
virtual GetPlatformType()This method is used to retrieve the ECMAScript object .
RemoveEventListener(string, IEventListener)This method allows the removal of event listeners from the event target. If an is removed from an while it is processing an event, it will not be triggered by the current actions. Event Listeners can never be invoked after being removed.
RemoveEventListener(string, DOMEventHandler, bool)This method allows the removal of event listeners from the event target. If an is removed from an while it is processing an event, it will not be triggered by the current actions. Event Listeners can never be invoked after being removed.
RemoveEventListener(string, IEventListener, bool)This method allows the removal of event listeners from the event target. If an is removed from an while it is processing an event, it will not be triggered by the current actions. Event Listeners can never be invoked after being removed.

See Also