MultiSelectPrompt<T>
ConsoleMonster.Interactive
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<T>
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.
Returned or exposed by 12
- Method MultiSelectPromptFluent.Choices``1
- Method MultiSelectPromptFluent.Choice``1
- Method MultiSelectPromptFluent.Collapsed``1
- Method MultiSelectPromptFluent.Default``1
- Method MultiSelectPromptFluent.Description``1
- Method MultiSelectPromptFluent.Maximum``1
- Method MultiSelectPromptFluent.Minimum``1
- Method MultiSelectPromptFluent.PageSize``1
- Method MultiSelectPromptFluent.ParameterName``1
- Method MultiSelectPromptFluent.PreviewBy``1
- Method MultiSelectPromptFluent.PreviewTextBy``1
- Method MultiSelectPromptFluent.Title``1
Accepted by parameters 12
- Method MultiSelectPromptFluent.Choices``1
- Method MultiSelectPromptFluent.Choice``1
- Method MultiSelectPromptFluent.Collapsed``1
- Method MultiSelectPromptFluent.Default``1
- Method MultiSelectPromptFluent.Description``1
- Method MultiSelectPromptFluent.Maximum``1
- Method MultiSelectPromptFluent.Minimum``1
- Method MultiSelectPromptFluent.PageSize``1
- Method MultiSelectPromptFluent.ParameterName``1
- Method MultiSelectPromptFluent.PreviewBy``1
- Method MultiSelectPromptFluent.PreviewTextBy``1
- Method MultiSelectPromptFluent.Title``1
Type Parameters
- T
- The value type.
Constructors
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
- The question.
- values System.Collections.Generic.IEnumerable<T?>
- The values.
- display System.Func<T?, string>? = null
- The title of a value; null uses its text.
- group System.Func<T?, string?>? = null
- 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
- The question.
- choices System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.Choice>
- 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?>
- The answer.
Returns
string The text.Inherited Methods
public virtual IReadOnlyList<T> Show(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
IReadOnlyList<T>public Task<IReadOnlyList<T>> ShowAsync(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
Task<IReadOnlyList<T>>public IWidget Snapshot(InteractiveOptions? options = null) #Parameters
- options InteractiveOptions? = null
Returns
IWidgetpublic bool TryShow(out IReadOnlyList<T> value, InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- value IReadOnlyList<T>
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
boolProperties
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 bool Collapsed { get; set; } #Starts with every group collapsed (long grouped lists).