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
originalRealmInfo
Properties
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
Origin
Gets the origin of the realm.
[JsonPropertyName("origin")]
[JsonRequired]
[JsonInclude]
public string Origin { get; }
Property Value
RealmId
Gets the ID of the realm.
[JsonPropertyName("realm")]
[JsonRequired]
[JsonInclude]
public string RealmId { get; }
Property Value
Type
Gets the type of the realm.
[JsonPropertyName("type")]
[JsonRequired]
[JsonInclude]
public RealmType Type { get; }
Property Value
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
TThe 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
objobject
Returns
Equals(RealmInfo?)
public virtual bool Equals(RealmInfo? other)
Parameters
otherRealmInfo
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
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
resultTWhen this method returns, contains the cast value or null if the cast failed.
Returns
Type Parameters
TThe specific type of RealmInfo to return.
Operators
operator ==(RealmInfo?, RealmInfo?)
public static bool operator ==(RealmInfo? left, RealmInfo? right)
Parameters
Returns
operator !=(RealmInfo?, RealmInfo?)
public static bool operator !=(RealmInfo? left, RealmInfo? right)