Table of Contents

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 string

The type of the event.

bubbles bool

If the event is bubbling.

cancelable bool

If the event is cancelable.

data object

Sets the data for the message event.

origin string

Sets the origin who send the message.

lastEventId string

Sets the id of the last event.

source IWindow

Sets 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

object

LastEventId

Gets the id of the last event.

[DomName("lastEventId")]
public string LastEventId { get; }

Property Value

string

Origin

Gets the origin of the message.

[DomName("origin")]
public string Origin { get; }

Property Value

string

Ports

Gets the used message ports.

[DomName("ports")]
public IMessagePort[] Ports { get; }

Property Value

IMessagePort[]

Source

Gets the source of the message.

[DomName("source")]
public IWindow? Source { get; }

Property Value

IWindow

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 string

The type of event.

bubbles bool

Determines if the event bubbles.

cancelable bool

Determines if the event is cancelable.

data object

Sets the data for the message event.

origin string

Sets the origin who send the message.

lastEventId string

Sets the id of the last event.

source IWindow

Sets the source window of the message.

ports IMessagePort[]

The message ports to include.