TextPromptExtensions Class

Contains extension methods for TextPrompt<T>.
public static class TextPromptExtensions
Namespace
Spectre.Console

Methods

static TextPrompt<T> AddChoice<T>(TextPrompt<T>, T)
Adds a choice to the prompt.
static TextPrompt<T> AddChoices<T>(TextPrompt<T>, IEnumerable<T>)
Adds multiple choices to the prompt.
static TextPrompt<T> AllowEmpty<T>(TextPrompt<T>)
Allow empty input.
static TextPrompt<T> ChoicesStyle<T>(TextPrompt<T>, Style)
Sets the style in which the list of choices is displayed.
static TextPrompt<T> DefaultValue<T>(TextPrompt<T>, T)
Sets the default value of the prompt.
static TextPrompt<T> DefaultValueStyle<T>(TextPrompt<T>, Style)
Sets the style in which the default value is displayed.
static TextPrompt<T> HideChoices<T>(TextPrompt<T>)
Hides choices.
static TextPrompt<T> HideDefaultValue<T>(TextPrompt<T>)
Hides the default value.
static TextPrompt<T> InvalidChoiceMessage<T>(TextPrompt<T>, string)
Sets the "invalid choice" message for the prompt.
static TextPrompt<T> PromptStyle<T>(TextPrompt<T>, Style)
Sets the prompt style.
static TextPrompt<T> Secret<T>(TextPrompt<T>, char?)
Replaces prompt user input with mask in the console.
static TextPrompt<T> Secret<T>(TextPrompt<T>)
Replaces prompt user input with asterisks in the console.
static TextPrompt<T> ShowChoices<T>(TextPrompt<T>, bool)
Show or hide choices.
static TextPrompt<T> ShowChoices<T>(TextPrompt<T>)
Shows choices.
static TextPrompt<T> ShowDefaultValue<T>(TextPrompt<T>, bool)
Show or hide the default value.
static TextPrompt<T> ShowDefaultValue<T>(TextPrompt<T>)
Shows the default value.
static TextPrompt<T> Validate<T>(TextPrompt<T>, Func<T, bool>, string)
Sets the validation criteria for the prompt.
static TextPrompt<T> Validate<T>(TextPrompt<T>, Func<T, ValidationResult>)
Sets the validation criteria for the prompt.
static TextPrompt<T> ValidationErrorMessage<T>(TextPrompt<T>, string)
Sets the validation error message for the prompt.
static TextPrompt<T> WithConverter<T>(TextPrompt<T>, Func<T, string>)
Sets the function to create a display string for a given choice.