Skip to content
ConsoleMonster

API Reference

Class

MultiSelectPrompt`1

Namespace ConsoleMonster.Interactive
Assembly ConsoleMonster
Base Prompt<IReadOnlyList<T>>
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

  • Prompt<IReadOnlyList<T>>
  • MultiSelectPrompt`1

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 System.String requiredposition: 0
The question.
values System.Collections.Generic.IEnumerable<T?> requiredposition: 1
The values.
display System.Func<T?, System.String>? = null optionalposition: 2
The title of a value; null uses its text.
group System.Func<T?, System.String?>? = null optionalposition: 3
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 System.String requiredposition: 0
The question.
choices System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.Choice> requiredposition: 1
The choices.

Methods

public override String Describe(IReadOnlyList<T?> value) #
Returns: String

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

Parameters

value System.Collections.Generic.IReadOnlyList<T?> requiredposition: 0
The answer.

Returns

The text.

Properties

public IList<Choice> Choices { get; } #

The choices, in display order.

public Int32? Minimum { get; set; } #

The fewest values accepted.

public Int32? Maximum { get; set; } #

The most values accepted.

public Func<T?, IWidget?>? Preview { get; set; } #

Preview content for the focused value.

public Func<T?, String?>? PreviewText { get; set; } #

Preview text for the focused value.

public Int32 PageSize { get; set; } #

The preferred number of visible rows.

public Boolean Collapsed { get; set; } #

Starts with every group collapsed (long grouped lists).