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
originalDateRemoteValue
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Handle
Gets the handle of this remote value.
[JsonPropertyName("handle")]
[JsonInclude]
public string? Handle { get; }
Property Value
InternalId
Gets the internal ID of this remote value.
[JsonPropertyName("internalId")]
[JsonInclude]
public string? InternalId { get; }
Property Value
Value
Gets the DateTime value of this remote value.
[JsonPropertyName("value")]
[JsonInclude]
[JsonRequired]
[JsonConverter(typeof(ExpandedYearDateTimeJsonConverter))]
public override DateTime Value { get; }
Property Value
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
objobject
Returns
Equals(DateRemoteValue?)
public virtual bool Equals(DateRemoteValue? other)
Parameters
otherDateRemoteValue
Returns
Equals(ValueHoldingRemoteValue<DateTime>?)
public override sealed bool Equals(ValueHoldingRemoteValue<DateTime>? other)
Parameters
otherValueHoldingRemoteValue<DateTime>
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
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
Operators
operator ==(DateRemoteValue?, DateRemoteValue?)
public static bool operator ==(DateRemoteValue? left, DateRemoteValue? right)
Parameters
leftDateRemoteValuerightDateRemoteValue
Returns
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
valueDateRemoteValueThe value to convert.
Returns
operator !=(DateRemoteValue?, DateRemoteValue?)
public static bool operator !=(DateRemoteValue? left, DateRemoteValue? right)
Parameters
leftDateRemoteValuerightDateRemoteValue