Skip to content
ConsoleMonster
Class

Select

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Implements
IWidget
Modifiers
sealed

A filtered single-choice layout input. Arrows move; Enter or Space commits the focused choice.

Inheritance

Usage

Explore 24 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 12

Constructors

public Select(string name, IEnumerable<Choice> choices) #

Creates a single-choice input with no committed value.

Parameters

name string required
The application-state key.
choices System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.Choice> required
Available choices, configured before running.

Properties

public object? Value { get; set; } #

The committed value; null also represents an empty selection. Assign only enabled choices' values.

Exceptions

  • ArgumentException – A non-null value does not identify an enabled choice.

Extension Methods

public static Select WithEnabled(Select select, bool value = true) #

Sets InputControl.Enabled: Whether the control accepts input and participates in focus traversal.

Parameters

select ConsoleMonster.Interactive.Select required
The instance.
value bool = true optional
The value (default true).

Returns

Select The same instance.
public static Select WithLabel(Select select, string? value) #

Sets InputControl.Label: The visible label, or null to use the name.

Parameters

select ConsoleMonster.Interactive.Select required
The instance.
value string? required
The value.

Returns

Select The same instance.
public static Select WithPageSize(Select select, int value) #

Sets SelectionInputBase.PageSize: The preferred number of choice rows, at least one. Set before running.

Parameters

select ConsoleMonster.Interactive.Select required
The instance.
value int required
The value.

Returns

Select The same instance.
public static Select WithTabIndex(Select select, int value) #

Sets InputControl.TabIndex: Focus order; equal values preserve declaration order.

Parameters

select ConsoleMonster.Interactive.Select required
The instance.
value int required
The value.

Returns

Select The same instance.
public static Select WithValidationMessage(Select select, string? value) #

Sets InputControl.ValidationMessage: The current validation message below the control, or null.

Parameters

select ConsoleMonster.Interactive.Select required
The instance.
value string? required
The value.

Returns

Select The same instance.
public static Select WithValue(Select select, object? value) #

Sets Select.Value: The committed value; null also represents an empty selection. Assign only enabled choices' values.

Parameters

select ConsoleMonster.Interactive.Select required
The instance.
value object? required
The value.

Returns

Select The same instance.