Table of Contents

Class RealmInfo

Namespace
WebDriverBiDi.Script
Assembly
WebDriverBiDi.dll

Object containing information about a script realm.

[JsonConverter(typeof(DiscriminatedUnionJsonConverter<RealmInfo>))]
[DiscriminatedTypeProperty("type")]
[DiscriminatedDerivedType(typeof(WindowRealmInfo), "window")]
[DiscriminatedDerivedType(typeof(DedicatedWorkerRealmInfo), "dedicated-worker")]
[DiscriminatedDerivedType(typeof(SharedWorkerRealmInfo), "shared-worker")]
[DiscriminatedDerivedType(typeof(ServiceWorkerRealmInfo), "service-worker")]
[DiscriminatedDerivedType(typeof(WorkerRealmInfo), "worker")]
[DiscriminatedDerivedType(typeof(PaintWorkletRealmInfo), "paint-worklet")]
[DiscriminatedDerivedType(typeof(AudioWorkletRealmInfo), "audio-worklet")]
[DiscriminatedDerivedType(typeof(WorkletRealmInfo), "worklet")]
public abstract record RealmInfo : IEquatable<RealmInfo>
Inheritance
RealmInfo
Implements
Derived
Inherited Members

Constructors

RealmInfo(RealmInfo)

protected RealmInfo(RealmInfo original)

Parameters

original RealmInfo

Properties

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Origin

Gets the origin of the realm.

[JsonPropertyName("origin")]
[JsonRequired]
[JsonInclude]
public string Origin { get; }

Property Value

string

RealmId

Gets the ID of the realm.

[JsonPropertyName("realm")]
[JsonRequired]
[JsonInclude]
public string RealmId { get; }

Property Value

string

Type

Gets the type of the realm.

[JsonPropertyName("type")]
[JsonRequired]
[JsonInclude]
public RealmType Type { get; }

Property Value

RealmType

Methods

As<T>()

Casts this RealmInfo to a type-specific realm info, throwing if it is not of that type. Use TryAs<T>(out T?) to test without throwing.

public T As<T>() where T : RealmInfo

Returns

T

This instance cast to the specified correct type.

Type Parameters

T

The specific type of RealmInfo to return.

Exceptions

WebDriverBiDiException

Thrown if this RealmInfo is not the specified type.

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(RealmInfo?)

public virtual bool Equals(RealmInfo? other)

Parameters

other RealmInfo

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

TryAs<T>(out T?)

Attempts to cast this RealmInfo to a type-specific realm info, returning false rather than throwing when it is not of that type.

public bool TryAs<T>(out T? result) where T : RealmInfo

Parameters

result T

When this method returns, contains the cast value or null if the cast failed.

Returns

bool

true if the cast was successful; otherwise, false.

Type Parameters

T

The specific type of RealmInfo to return.

Operators

operator ==(RealmInfo?, RealmInfo?)

public static bool operator ==(RealmInfo? left, RealmInfo? right)

Parameters

left RealmInfo
right RealmInfo

Returns

bool

operator !=(RealmInfo?, RealmInfo?)

public static bool operator !=(RealmInfo? left, RealmInfo? right)

Parameters

left RealmInfo
right RealmInfo

Returns

bool