API Reference
Class
MultiSelectPrompt`1
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
- The question.
- values System.Collections.Generic.IEnumerable<T?>
- The values.
- display System.Func<T?, System.String>? = null
- The title of a value; null uses its text.
- group System.Func<T?, System.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 System.String
- The question.
- choices System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.Choice>
- The choices.
Methods
public override String Describe(IReadOnlyList<T?> value) #Returns:
StringThe answer as text, for the summary line left in the scrollback.
Parameters
- value System.Collections.Generic.IReadOnlyList<T?>
- The answer.
Returns
The text.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?
public IReadOnlyList<T> Show(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Returns:
IReadOnlyList<T>Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
public Task<IReadOnlyList<T>> ShowAsync(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Returns:
Task<IReadOnlyList<T>>Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
public Boolean TryShow(out IReadOnlyList<T> value, InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Returns:
BooleanParameters
- value IReadOnlyList<T>
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default