EventTarget Class

https://dom.spec.whatwg.org/#interface-eventtarget

public class EventTarget

Constructors

NameDescription
EventTarget()Creates an event target.

EventTarget()

EventTarget.cs

Creates an event target.

public EventTarget()

Methods

NameDescription
AddEventListener(string, IEventListener?, AddEventListenerOptions?)Registers the listener for events of the given type with the given options.
AddEventListener(string, IEventListener?, bool)Registers the listener for events of the given type, in the capture phase when useCapture is true.
AddEventListener(string, Action<Event>?, AddEventListenerOptions?)Registers the delegate as a listener for events of the given type with the given options.
AddEventListener(string, Action<Event>?, bool)Registers the delegate as a listener for events of the given type, in the capture phase when useCapture is true.
DispatchEvent(Event)https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent
RemoveEventListener(string, IEventListener?, EventListenerOptions?)Removes the listener registered for events of the given type and capture setting.
RemoveEventListener(string, IEventListener?, bool)Removes the listener registered for events of the given type and capture setting.
RemoveEventListener(string, Action<Event>?, EventListenerOptions?)Removes the delegate registered as a listener for events of the given type and capture setting.
RemoveEventListener(string, Action<Event>?, bool)Removes the delegate registered as a listener for events of the given type and capture setting.

AddEventListener overloads

AddEventListener(string, IEventListener?, AddEventListenerOptions?)

EventTarget.cs

Registers the listener for events of the given type with the given options.

public void AddEventListener(string type, IEventListener? callback, AddEventListenerOptions? options = null)

AddEventListener(string, IEventListener?, bool)

EventTarget.cs

Registers the listener for events of the given type, in the capture phase when useCapture is true.

public void AddEventListener(string type, IEventListener? callback, bool useCapture)

AddEventListener(string, Action<Event>?, AddEventListenerOptions?)

EventTarget.cs

Registers the delegate as a listener for events of the given type with the given options.

public void AddEventListener(string type, Action<Event>? callback, AddEventListenerOptions? options = null)
Parameters
type string
callback Action<Event>?
options AddEventListenerOptions?

AddEventListener(string, Action<Event>?, bool)

EventTarget.cs

Registers the delegate as a listener for events of the given type, in the capture phase when useCapture is true.

public void AddEventListener(string type, Action<Event>? callback, bool useCapture)
Parameters
type string
callback Action<Event>?
useCapture bool

DispatchEvent(Event)

EventTarget.cs

https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent

public bool DispatchEvent(Event @event)

RemoveEventListener overloads

RemoveEventListener(string, IEventListener?, EventListenerOptions?)

EventTarget.cs

Removes the listener registered for events of the given type and capture setting.

public void RemoveEventListener(string type, IEventListener? callback, EventListenerOptions? options = null)

RemoveEventListener(string, IEventListener?, bool)

EventTarget.cs

Removes the listener registered for events of the given type and capture setting.

public void RemoveEventListener(string type, IEventListener? callback, bool useCapture)

RemoveEventListener(string, Action<Event>?, EventListenerOptions?)

EventTarget.cs

Removes the delegate registered as a listener for events of the given type and capture setting.

public void RemoveEventListener(string type, Action<Event>? callback, EventListenerOptions? options = null)
Parameters
type string
callback Action<Event>?
options EventListenerOptions?

RemoveEventListener(string, Action<Event>?, bool)

EventTarget.cs

Removes the delegate registered as a listener for events of the given type and capture setting.

public void RemoveEventListener(string type, Action<Event>? callback, bool useCapture)
Parameters
type string
callback Action<Event>?
useCapture bool