MessageEvent
Represents the event arguments when receiving a message.
using AngleSharp.Attributes;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
namespace AngleSharp.Dom.Events
{
[System.Runtime.CompilerServices.NullableContext(1)]
[System.Runtime.CompilerServices.Nullable(0)]
[DomName("MessageEvent")]
public class MessageEvent : Event
{
[System.Runtime.CompilerServices.Nullable(2)]
[DomName("data")]
[field: System.Runtime.CompilerServices.Nullable(2)]
public object Data {
[System.Runtime.CompilerServices.NullableContext(2)]
get;
[System.Runtime.CompilerServices.NullableContext(2)]
private set;
}
[DomName("origin")]
public string Origin { get; set; }
[DomName("lastEventId")]
public string LastEventId { get; set; }
[System.Runtime.CompilerServices.Nullable(2)]
[DomName("source")]
[field: System.Runtime.CompilerServices.Nullable(2)]
public IWindow Source {
[System.Runtime.CompilerServices.NullableContext(2)]
get;
[System.Runtime.CompilerServices.NullableContext(2)]
private set;
}
[DomName("ports")]
public IMessagePort[] Ports { get; set; }
public MessageEvent()
{
}
[System.Runtime.CompilerServices.NullableContext(2)]
[DomConstructor]
[DomInitDict(1, true)]
public MessageEvent([System.Runtime.CompilerServices.Nullable(1)] string type, bool bubbles = false, bool cancelable = false, object data = null, string origin = null, string lastEventId = null, IWindow source = null, [System.Runtime.CompilerServices.Nullable(1)] params IMessagePort[] ports)
{
Init(type, bubbles, cancelable, data, origin ?? string.Empty, lastEventId ?? string.Empty, source, ports);
}
[DomName("initMessageEvent")]
[System.Diagnostics.CodeAnalysis.MemberNotNull(new string[] {
"Origin",
"LastEventId",
"Ports"
})]
public void Init(string type, bool bubbles, bool cancelable, [System.Runtime.CompilerServices.Nullable(2)] object data, string origin, string lastEventId, [System.Runtime.CompilerServices.Nullable(2)] IWindow source, params IMessagePort[] ports)
{
Init(type, bubbles, cancelable);
Data = data;
Origin = origin;
LastEventId = lastEventId;
Source = source;
Ports = ports;
}
}
}