Skip to content
ConsoleMonster
Class

MultiSelectPrompt<T>

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
sealed

Pick any number of values: everything the single selection does, plus tri-state group checkboxes (Space on a group toggles all of it; arrows collapse and expand), select all/none/invert, a minimum and maximum, a live "24 of 312 selected" count and a selected-only view (Ctrl+O). Returns the chosen values in list order.

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

Type Parameters

T
The value type.

Constructors

MultiSelectPrompt 2 overloads
public MultiSelectPrompt<T>(string title, IEnumerable<T?> values, Func<T?, string>? display = null, Func<T?, string?>? group = null) #

Creates a multi-selection from values.

Parameters

title string required
The question.
values System.Collections.Generic.IEnumerable<T?> required
The values.
display System.Func<T?, string>? = null optional
The title of a value; null uses its text.
group System.Func<T?, string?>? = null optional
The group of a value; null for none.
public MultiSelectPrompt<T>(string title, IEnumerable<Choice> choices) #

Creates a multi-selection from prepared choices.

Parameters

title string required
The question.
choices System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.Choice> required
The choices.

Methods

public override string Describe(IReadOnlyList<T?> value) #

The answer as text, for the summary line left in the scrollback.

Parameters

value System.Collections.Generic.IReadOnlyList<T?> required
The answer.

Returns

string The text.

Properties

public IList<Choice> Choices { get; } #

The choices, in display order.

public int? Minimum { get; set; } #

The fewest values accepted.

public int? Maximum { get; set; } #

The most values accepted.

public Func<T?, IWidget?>? Preview { get; set; } #
Fluent("PreviewBy")

Preview content for the focused value.

public Func<T?, string?>? PreviewText { get; set; } #
Fluent("PreviewTextBy")

Preview text for the focused value.

public int PageSize { get; set; } #

The preferred number of visible rows.

public bool Collapsed { get; set; } #

Starts with every group collapsed (long grouped lists).