BooleanOrString Struct

The (boolean or DOMString) union of the echoCancellation constrainable property: a boolean, or an echo cancellation mode (all, remote-only).

public readonly struct BooleanOrString : IEquatable<BooleanOrString>
Implements

Properties

NameDescription
FlagGets the boolean when the union holds it, otherwise null.
TextGets the string when the union holds it, otherwise null.
ValueGets the value of the union: Boolean or String.

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

public bool? Flag { get; }

Property value

bool?

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

public string? Text { get; }

Property value

string?

Gets the value of the union: Boolean or String.

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(BooleanOrString)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 boolean.
FromString(string)Creates the union from the string.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(BooleanOrString)

MediaCaptureUnions.cs

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

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

public static BooleanOrString FromBoolean(bool value)

Parameters

value bool

Returns

BooleanOrString

FromString(string)

MediaCaptureUnions.cs

Creates the union from the string.

public static BooleanOrString FromString(string value)

Parameters

value string

Returns

BooleanOrString

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

operator ==(BooleanOrString, BooleanOrString)

MediaCaptureUnions.cs

Returns whether the two unions hold the same value.

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

Parameters

left BooleanOrString
right BooleanOrString

Returns

bool

op_Implicit overloads

implicit operator BooleanOrString(bool)

MediaCaptureUnions.cs

Creates the union from the boolean.

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

BooleanOrString

implicit operator BooleanOrString(string)

MediaCaptureUnions.cs

Creates the union from the string.

public static implicit operator BooleanOrString(string value)
Parameters
value string
Returns

BooleanOrString

operator !=(BooleanOrString, BooleanOrString)

MediaCaptureUnions.cs

Returns whether the two unions hold different values.

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

Parameters

left BooleanOrString
right BooleanOrString

Returns

bool