ConstrainBoolean Struct

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

public readonly struct ConstrainBoolean : IEquatable<ConstrainBoolean>
Implements

Properties

NameDescription
BareGets the bare value when the union holds it, otherwise null.
ParametersGets the parameters when the union holds it, otherwise null.
ValueGets the value of the union: Boolean or ConstrainBooleanParameters.

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

public bool? Bare { get; }

Property value

bool?

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

public ConstrainBooleanParameters? Parameters { get; }

Gets the value of the union: Boolean or ConstrainBooleanParameters.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(ConstrainBoolean)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.
FromBoolean(bool)Creates the union from the bare value.
FromConstrainBooleanParameters(ConstrainBooleanParameters)Creates the union from the parameters.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(ConstrainBoolean)

MediaCaptureUnions.cs

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

public bool Equals(ConstrainBoolean other)
Parameters
other ConstrainBoolean
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.

FromBoolean(bool)

MediaCaptureUnions.cs

Creates the union from the bare value.

public static ConstrainBoolean FromBoolean(bool value)

Parameters

value bool

Returns

ConstrainBoolean

FromConstrainBooleanParameters(ConstrainBooleanParameters)

MediaCaptureUnions.cs

Creates the union from the parameters.

public static ConstrainBoolean FromConstrainBooleanParameters(ConstrainBooleanParameters value)

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 ==(ConstrainBoolean, ConstrainBoolean)Returns whether the two unions hold the same value.
implicit operator ConstrainBoolean(ConstrainBooleanParameters)Creates the union from the parameters.
implicit operator ConstrainBoolean(bool)Creates the union from the bare value.
operator !=(ConstrainBoolean, ConstrainBoolean)Returns whether the two unions hold different values.

operator ==(ConstrainBoolean, ConstrainBoolean)

MediaCaptureUnions.cs

Returns whether the two unions hold the same value.

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

Parameters

left ConstrainBoolean
right ConstrainBoolean

Returns

bool

op_Implicit overloads

implicit operator ConstrainBoolean(ConstrainBooleanParameters)

MediaCaptureUnions.cs

Creates the union from the parameters.

public static implicit operator ConstrainBoolean(ConstrainBooleanParameters value)

implicit operator ConstrainBoolean(bool)

MediaCaptureUnions.cs

Creates the union from the bare value.

public static implicit operator ConstrainBoolean(bool value)
Parameters
value bool
Returns

ConstrainBoolean

operator !=(ConstrainBoolean, ConstrainBoolean)

MediaCaptureUnions.cs

Returns whether the two unions hold different values.

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

Parameters

left ConstrainBoolean
right ConstrainBoolean

Returns

bool