Table of Contents

Class SelectionTypeInfo

Namespace
BlazOrbit.Abstractions
Assembly
BlazOrbit.Core.dll

Reflective shape descriptor for a selection value type. Detects single vs. multi-select mode and builds the materialize/extract pair used by SelectionState<TValue>.

public sealed class SelectionTypeInfo
Inheritance
object
SelectionTypeInfo

Constructors

SelectionTypeInfo(Type)

public SelectionTypeInfo(Type valueType)

Parameters

valueType Type

Concrete CLR type of the selection value. May be a scalar (single-select), an array (T[]) or a generic collection (System.Collections.Generic.List<T>, System.Collections.Generic.HashSet<T>). For multi-select collection types the ctor needs the parameterless constructor and an Add method preserved on valueType.

Properties

ElementType

Element type carried by the selection (the inner T for collections).

public Type ElementType { get; }

Property Value

Type

IsMultiple

True when ValueType is a collection / array type.

public bool IsMultiple { get; }

Property Value

bool

ValueType

The original CLR type that was inspected.

public Type ValueType { get; }

Property Value

Type

Methods

ContainsValue(object?, object?)

Returns whether collection contains value.

public bool ContainsValue(object? collection, object? value)

Parameters

collection object
value object

Returns

bool

CreateValue<TValue>(IEnumerable<object>)

Builds a value of TValue from the supplied items.

public TValue CreateValue<TValue>(IEnumerable<object> values)

Parameters

values IEnumerable<object>

Returns

TValue

Type Parameters

TValue

ExtractValues(object?)

Unpacks a value into its constituent items (single-element sequence for scalars).

public IEnumerable<object> ExtractValues(object? value)

Parameters

value object

Returns

IEnumerable<object>

ValuesEqual(object?, object?)

Default value-equality used across selection comparisons.

public bool ValuesEqual(object? a, object? b)

Parameters

a object
b object

Returns

bool