ConstrainDouble Struct

The ConstrainDouble typedef (https://w3c.github.io/mediacapture-main/#dom-constraindouble): a bare value, or a range with an exact and an ideal value.

public readonly struct ConstrainDouble : IEquatable<ConstrainDouble>
Implements

Properties

NameDescription
BareGets the bare value when the union holds it, otherwise null.
RangeGets the range when the union holds it, otherwise null.
ValueGets the value of the union: Double or ConstrainDoubleRange.

Gets the bare value when the union holds it, otherwise null.

public double? Bare { get; }

Property value

double?

Gets the range when the union holds it, otherwise null.

public ConstrainDoubleRange? Range { get; }

Property value

ConstrainDoubleRange?

Gets the value of the union: Double or ConstrainDoubleRange.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(ConstrainDouble)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
FromConstrainDoubleRange(ConstrainDoubleRange)Creates the union from the range.
FromDouble(double)Creates the union from the bare value.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(ConstrainDouble)

MediaCaptureUnions.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ConstrainDouble other)
Parameters
other ConstrainDouble
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

MediaCaptureUnions.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

FromConstrainDoubleRange(ConstrainDoubleRange)

MediaCaptureUnions.cs

Creates the union from the range.

public static ConstrainDouble FromConstrainDoubleRange(ConstrainDoubleRange value)

FromDouble(double)

MediaCaptureUnions.cs

Creates the union from the bare value.

public static ConstrainDouble FromDouble(double value)

Parameters

value double

Returns

ConstrainDouble

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Operators

NameDescription
operator ==(ConstrainDouble, ConstrainDouble)Returns whether the two unions hold the same value.
implicit operator ConstrainDouble(ConstrainDoubleRange)Creates the union from the range.
implicit operator ConstrainDouble(double)Creates the union from the bare value.
operator !=(ConstrainDouble, ConstrainDouble)Returns whether the two unions hold different values.

operator ==(ConstrainDouble, ConstrainDouble)

MediaCaptureUnions.cs

Returns whether the two unions hold the same value.

public static bool operator ==(ConstrainDouble left, ConstrainDouble right)

Parameters

left ConstrainDouble
right ConstrainDouble

Returns

bool

op_Implicit overloads

implicit operator ConstrainDouble(ConstrainDoubleRange)

MediaCaptureUnions.cs

Creates the union from the range.

public static implicit operator ConstrainDouble(ConstrainDoubleRange value)

implicit operator ConstrainDouble(double)

MediaCaptureUnions.cs

Creates the union from the bare value.

public static implicit operator ConstrainDouble(double value)
Parameters
value double
Returns

ConstrainDouble

operator !=(ConstrainDouble, ConstrainDouble)

MediaCaptureUnions.cs

Returns whether the two unions hold different values.

public static bool operator !=(ConstrainDouble left, ConstrainDouble right)

Parameters

left ConstrainDouble
right ConstrainDouble

Returns

bool