StringOrStringList Struct

The (DOMString or sequence<DOMString>) union of the exact and ideal values of a ConstrainDomStringParameters: a value, or a list of values.

public readonly struct StringOrStringList : IEquatable<StringOrStringList>
Implements

Properties

NameDescription
ManyGets the list of values when the union holds it, otherwise null.
OneGets the value when the union holds it, otherwise null.
ValueGets the value of the union: String or string[].

Gets the list of values when the union holds it, otherwise null.

public IReadOnlyList<string>? Many { get; }

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

public string? One { get; }

Property value

string?

Gets the value of the union: String or string[].

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(StringOrStringList)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.
FromString(string)Creates the union from the value.
FromStrings(string[])Creates the union from the list of values.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(StringOrStringList)

MediaCaptureUnions.cs

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

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

FromString(string)

MediaCaptureUnions.cs

Creates the union from the value.

public static StringOrStringList FromString(string value)

Parameters

value string

Returns

StringOrStringList

FromStrings(string[])

MediaCaptureUnions.cs

Creates the union from the list of values.

public static StringOrStringList FromStrings(string[] value)

Parameters

value string[]

Returns

StringOrStringList

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 ==(StringOrStringList, StringOrStringList)Returns whether the two unions hold the same value.
implicit operator StringOrStringList(string)Creates the union from the value.
implicit operator StringOrStringList(string[])Creates the union from the list of values.
operator !=(StringOrStringList, StringOrStringList)Returns whether the two unions hold different values.

operator ==(StringOrStringList, StringOrStringList)

MediaCaptureUnions.cs

Returns whether the two unions hold the same value.

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

Parameters

left StringOrStringList
right StringOrStringList

Returns

bool

op_Implicit overloads

implicit operator StringOrStringList(string)

MediaCaptureUnions.cs

Creates the union from the value.

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

StringOrStringList

implicit operator StringOrStringList(string[])

MediaCaptureUnions.cs

Creates the union from the list of values.

public static implicit operator StringOrStringList(string[] value)
Parameters
value string[]
Returns

StringOrStringList

operator !=(StringOrStringList, StringOrStringList)

MediaCaptureUnions.cs

Returns whether the two unions hold different values.

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

Parameters

left StringOrStringList
right StringOrStringList

Returns

bool