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
stringThe 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
stringThe type of the event.
bubbles
boolIf the event is bubbling.
cancelable
boolIf 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
stringThe type of the event.
bubbles
boolIf the event is bubbling.
cancelable
boolIf the event is cancelable.
composed
boolIf the event is composable.
Properties
CurrentTarget
Gets the current target (if bubbled).
[DomName("currentTarget")]
public IEventTarget? CurrentTarget { get; }
Property Value
IsBubbling
Gets if the event is actually bubbling.
[DomName("bubbles")]
public bool IsBubbling { get; }
Property Value
IsCancelable
Gets if the event is cancelable.
[DomName("cancelable")]
public bool IsCancelable { get; }
Property Value
IsComposed
Gets if the event is propagating across the shadow DOM boundary into the standard DOM.
[DomName("composed")]
public bool IsComposed { get; }
Property Value
IsDefaultPrevented
Gets if the default behavior has been prevented.
[DomName("defaultPrevented")]
public bool IsDefaultPrevented { get; }
Property Value
IsTrusted
Gets if the event is trusted.
[DomName("isTrusted")]
public bool IsTrusted { get; }
Property Value
OriginalTarget
Gets the original target of the event.
[DomName("target")]
public IEventTarget? OriginalTarget { get; }
Property Value
Phase
Gets the phase of the event.
[DomName("eventPhase")]
public EventPhase Phase { get; }
Property Value
Time
Gets the originating timestamp.
[DomName("timeStamp")]
public DateTime Time { get; }
Property Value
Type
Gets the type of event.
[DomName("type")]
public string Type { get; }
Property Value
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
Init(string, bool, bool)
Initializes the event.
[DomName("initEvent")]
public void Init(string type, bool bubbles, bool cancelable)
Parameters
type
stringThe type of the event.
bubbles
boolIf the event is bubbling.
cancelable
boolIf 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()