Class
SelectPrompt<T>
ConsoleMonster.Interactive
Pick one value from a list: type to filter (fuzzy, matches highlighted), groups, hotkeys, descriptions, badges, disabled choices with their reason, paging and an optional preview pane. Returns the value itself (any object).
Inheritance
- Prompt<T>
- SelectPrompt<T>
Usage
Explore 18 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 9
- Method SelectPromptFluent.Choices``1
- Method SelectPromptFluent.Choice``1
- Method SelectPromptFluent.Default``1
- Method SelectPromptFluent.Description``1
- Method SelectPromptFluent.PageSize``1
- Method SelectPromptFluent.ParameterName``1
- Method SelectPromptFluent.PreviewBy``1
- Method SelectPromptFluent.PreviewTextBy``1
- Method SelectPromptFluent.Title``1
Accepted by parameters 9
- Method SelectPromptFluent.Choices``1
- Method SelectPromptFluent.Choice``1
- Method SelectPromptFluent.Default``1
- Method SelectPromptFluent.Description``1
- Method SelectPromptFluent.PageSize``1
- Method SelectPromptFluent.ParameterName``1
- Method SelectPromptFluent.PreviewBy``1
- Method SelectPromptFluent.PreviewTextBy``1
- Method SelectPromptFluent.Title``1
Type Parameters
- T
- The value type.
Constructors
SelectPrompt 2 overloads
public SelectPrompt<T>(string title, IEnumerable<T?> values, Func<T?, string>? display = null, Func<T?, string?>? group = null) #Creates a 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 SelectPrompt<T>(string title, IEnumerable<Choice> choices) #Creates a selection from prepared choices (their values must be T).
Parameters
- title string
- The question.
- choices System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.Choice>
- The choices.
Methods
public override string Describe(T? value) #The answer as text, for the summary line left in the scrollback.
Parameters
- value T?
- The answer.
Returns
string The text.Inherited Methods
public virtual T? Show(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
T?public Task<T?> ShowAsync(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
Task<T?>public IWidget Snapshot(InteractiveOptions? options = null) #Parameters
- options InteractiveOptions? = null
Returns
IWidgetpublic bool TryShow(out T? value, InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- value T?
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
bool