Class MessageEvent
- Namespace
- AngleSharp.Dom.Events
- Assembly
- AngleSharp.dll
Represents the event arguments when receiving a message.
[DomName("MessageEvent")]
public class MessageEvent : Event
- Inheritance
-
MessageEvent
- Inherited Members
- Extension Methods
Constructors
MessageEvent()
Creates a new event.
public MessageEvent()
MessageEvent(string, bool, bool, object?, string?, string?, IWindow?, params IMessagePort[])
Creates a new event and initializes it.
[DomConstructor]
[DomInitDict(1, true)]
public MessageEvent(string type, bool bubbles = false, bool cancelable = false, object? data = null, string? origin = null, string? lastEventId = null, IWindow? source = null, params IMessagePort[] ports)
Parameters
type
stringThe type of the event.
bubbles
boolIf the event is bubbling.
cancelable
boolIf the event is cancelable.
data
objectSets the data for the message event.
origin
stringSets the origin who send the message.
lastEventId
stringSets the id of the last event.
source
IWindowSets the source window of the message.
ports
IMessagePort[]The message ports to include.
Properties
Data
Gets the data that is carried by the message.
[DomName("data")]
public object? Data { get; }
Property Value
LastEventId
Gets the id of the last event.
[DomName("lastEventId")]
public string LastEventId { get; }
Property Value
Origin
Gets the origin of the message.
[DomName("origin")]
public string Origin { get; }
Property Value
Ports
Gets the used message ports.
[DomName("ports")]
public IMessagePort[] Ports { get; }
Property Value
Source
Gets the source of the message.
[DomName("source")]
public IWindow? Source { get; }
Property Value
Methods
Init(string, bool, bool, object?, string, string, IWindow?, params IMessagePort[])
Initializes the message event.
[DomName("initMessageEvent")]
public void Init(string type, bool bubbles, bool cancelable, object? data, string origin, string lastEventId, IWindow? source, params IMessagePort[] ports)
Parameters
type
stringThe type of event.
bubbles
boolDetermines if the event bubbles.
cancelable
boolDetermines if the event is cancelable.
data
objectSets the data for the message event.
origin
stringSets the origin who send the message.
lastEventId
stringSets the id of the last event.
source
IWindowSets the source window of the message.
ports
IMessagePort[]The message ports to include.