Table of Contents

Class DateRemoteValue

Namespace
WebDriverBiDi.Script
Assembly
WebDriverBiDi.dll

Represents a remote value for a date object from the remote end, providing type-safe access to the value and the ability to convert to a local value for use as an argument for script execution on the remote end.

public record DateRemoteValue : ValueHoldingRemoteValue<DateTime>, IEquatable<RemoteValue>, IEquatable<ValueHoldingRemoteValue>, ITypeSafeRemoteValue<DateTime>, IEquatable<ValueHoldingRemoteValue<DateTime>>, IObjectReferenceRemoteValue, IEquatable<DateRemoteValue>
Inheritance
DateRemoteValue
Implements
Inherited Members

Constructors

DateRemoteValue(DateRemoteValue)

protected DateRemoteValue(DateRemoteValue original)

Parameters

original DateRemoteValue

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Handle

Gets the handle of this remote value.

[JsonPropertyName("handle")]
[JsonInclude]
public string? Handle { get; }

Property Value

string

InternalId

Gets the internal ID of this remote value.

[JsonPropertyName("internalId")]
[JsonInclude]
public string? InternalId { get; }

Property Value

string

Value

Gets the DateTime value of this remote value.

[JsonPropertyName("value")]
[JsonInclude]
[JsonRequired]
[JsonConverter(typeof(ExpandedYearDateTimeJsonConverter))]
public override DateTime Value { get; }

Property Value

DateTime

Remarks

The remote end serializes JavaScript Date objects in the format of Date.prototype.toISOString(), whose range (approximately years -271821 to +275760) exceeds that of DateTime (years 0001-9999). A date before the DateTime range deserializes as MinValue, and one after it as MaxValue, each with a Kind of Utc like every in-range value.

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(DateRemoteValue?)

public virtual bool Equals(DateRemoteValue? other)

Parameters

other DateRemoteValue

Returns

bool

Equals(ValueHoldingRemoteValue<DateTime>?)

public override sealed bool Equals(ValueHoldingRemoteValue<DateTime>? other)

Parameters

other ValueHoldingRemoteValue<DateTime>

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToLocalValue()

Converts this remote value to a local value for use as an argument for script execution on the remote end.

public override LocalValue ToLocalValue()

Returns

LocalValue

A LocalValue representing the date value.

ToRemoteObjectReference()

Converts this RemoteValue into a RemoteObjectReference.

public RemoteObjectReference ToRemoteObjectReference()

Returns

RemoteObjectReference

The RemoteObjectReference object representing this RemoteValue.

Exceptions

WebDriverBiDiException

Thrown when there is no handle set.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(DateRemoteValue?, DateRemoteValue?)

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

Parameters

left DateRemoteValue
right DateRemoteValue

Returns

bool

implicit operator DateTime(DateRemoteValue)

Defines an implicit conversion from a DateRemoteValue to a DateTime, allowing for easy access to the date value of this remote value.

public static implicit operator DateTime(DateRemoteValue value)

Parameters

value DateRemoteValue

The value to convert.

Returns

DateTime

operator !=(DateRemoteValue?, DateRemoteValue?)

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

Parameters

left DateRemoteValue
right DateRemoteValue

Returns

bool