ComponentVariantType Class

A variant type: one of several named cases, each with an optional payload.

public sealed class ComponentVariantType : ComponentValueType
Inheritance
ComponentValueType ComponentVariantType

Constructors

NameDescription
ComponentVariantType(IEnumerable<ComponentCase>)Initializes a new instance of the ComponentVariantType class.

ComponentVariantType(IEnumerable<ComponentCase>)

ComponentTypes.cs

Initializes a new instance of the ComponentVariantType class.

public ComponentVariantType(IEnumerable<ComponentCase> cases)

Parameters

cases IEnumerable<ComponentCase>
The cases, at least one.

Properties

NameDescription
CasesGets the cases.

Gets the cases.

public ImmutableArray<ComponentCase> Cases { get; }

Methods

NameDescription
Equals(ComponentValueType?)Indicates whether the current object is equal to another object of the same type.
GetHashCode()Serves as the default hash function.

Equals(ComponentValueType?)

ComponentTypes.cs

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

public override bool Equals(ComponentValueType? other)

Parameters

other ComponentValueType?
An object to compare with this object.

Returns

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

GetHashCode()

ComponentTypes.cs

Serves as the default hash function.

public override int GetHashCode()

Returns

int A hash code for the current object.