Table of Contents

Class Event

Namespace
AngleSharp.Dom.Events
Assembly
AngleSharp.dll

Represents an event argument.

[DomName("Event")]
public class Event : EventArgs
Inheritance
Event
Derived
Inherited Members
Extension Methods

Constructors

Event()

Creates a new event.

public Event()

Event(string)

Creates a new event and initializes it.

public Event(string type)

Parameters

type string

The type of the event.

Event(string, bool, bool)

Creates a new event and initializes it.

public Event(string type, bool bubbles = false, bool cancelable = false)

Parameters

type string

The type of the event.

bubbles bool

If the event is bubbling.

cancelable bool

If the event is cancelable.

Event(string, bool, bool, bool)

Creates a new event and initializes it.

[DomConstructor]
[DomInitDict(1, true)]
public Event(string type, bool bubbles = false, bool cancelable = false, bool composed = false)

Parameters

type string

The type of the event.

bubbles bool

If the event is bubbling.

cancelable bool

If the event is cancelable.

composed bool

If the event is composable.

Properties

CurrentTarget

Gets the current target (if bubbled).

[DomName("currentTarget")]
public IEventTarget? CurrentTarget { get; }

Property Value

IEventTarget

IsBubbling

Gets if the event is actually bubbling.

[DomName("bubbles")]
public bool IsBubbling { get; }

Property Value

bool

IsCancelable

Gets if the event is cancelable.

[DomName("cancelable")]
public bool IsCancelable { get; }

Property Value

bool

IsComposed

Gets if the event is propagating across the shadow DOM boundary into the standard DOM.

[DomName("composed")]
public bool IsComposed { get; }

Property Value

bool

IsDefaultPrevented

Gets if the default behavior has been prevented.

[DomName("defaultPrevented")]
public bool IsDefaultPrevented { get; }

Property Value

bool

IsTrusted

Gets if the event is trusted.

[DomName("isTrusted")]
public bool IsTrusted { get; }

Property Value

bool

OriginalTarget

Gets the original target of the event.

[DomName("target")]
public IEventTarget? OriginalTarget { get; }

Property Value

IEventTarget

Phase

Gets the phase of the event.

[DomName("eventPhase")]
public EventPhase Phase { get; }

Property Value

EventPhase

Time

Gets the originating timestamp.

[DomName("timeStamp")]
public DateTime Time { get; }

Property Value

DateTime

Type

Gets the type of event.

[DomName("type")]
public string Type { get; }

Property Value

string

Methods

Cancel()

Prevents the default behavior.

[DomName("preventDefault")]
public void Cancel()

GetComposedPath()

Returns the event's path which is an array of the objects on which listeners will be invoked. See https://dom.spec.whatwg.org/#dom-event-composedpath.

[DomName("composedPath")]
public IEnumerable<IEventTarget> GetComposedPath()

Returns

IEnumerable<IEventTarget>

Init(string, bool, bool)

Initializes the event.

[DomName("initEvent")]
public void Init(string type, bool bubbles, bool cancelable)

Parameters

type string

The type of the event.

bubbles bool

If the event is bubbling.

cancelable bool

If the event is cancelable.

Stop()

Prevents further propagation of the event.

[DomName("stopPropagation")]
public void Stop()

StopImmediately()

Stops the immediate propagation.

[DomName("stopImmediatePropagation")]
public void StopImmediately()