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