ConfirmPrompt
ConsoleMonster.Interactive
A yes/no question with the default shown: ? Continue? [ Yes ] No. Y and N answer at once, arrows move between the answers, Enter takes the focused one, Esc answers no.
Inheritance
- Prompt<bool>
- ConfirmPrompt
Usage
Explore 29 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 15
- Extension method ConfirmPrompt.Default
- Extension method ConfirmPrompt.Description
- Extension method ConfirmPrompt.Destructive
- Extension method ConfirmPrompt.NoText
- Extension method ConfirmPrompt.ParameterName
- Extension method ConfirmPrompt.Title
- Extension method ConfirmPrompt.YesText
- Method ConfirmPromptFluent.Default
- Method ConfirmPromptFluent.Description
- Method ConfirmPromptFluent.Destructive
- Method ConfirmPromptFluent.NoText
- Method ConfirmPromptFluent.ParameterName
- Method ConfirmPromptFluent.Title
- Method ConfirmPromptFluent.YesText
- Method Ui.ConfirmPrompt
Accepted by parameters 14
- Extension method ConfirmPrompt.Default
- Extension method ConfirmPrompt.Description
- Extension method ConfirmPrompt.Destructive
- Extension method ConfirmPrompt.NoText
- Extension method ConfirmPrompt.ParameterName
- Extension method ConfirmPrompt.Title
- Extension method ConfirmPrompt.YesText
- Method ConfirmPromptFluent.Default
- Method ConfirmPromptFluent.Description
- Method ConfirmPromptFluent.Destructive
- Method ConfirmPromptFluent.NoText
- Method ConfirmPromptFluent.ParameterName
- Method ConfirmPromptFluent.Title
- Method ConfirmPromptFluent.YesText
Constructors
Methods
public override string Describe(bool value) #The answer as text, for the summary line left in the scrollback.
Parameters
- value bool
- The answer.
Returns
string The text.Inherited Methods
public virtual bool Show(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
boolpublic Task<bool> ShowAsync(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
Task<bool>public IWidget Snapshot(InteractiveOptions? options = null) #Parameters
- options InteractiveOptions? = null
Returns
IWidgetpublic bool TryShow(out bool value, InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- value bool
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
boolProperties
public bool Destructive { get; set; } #Marks the question as destructive: a warning mark, and No is focused unless the default says otherwise.
public string? YesText { get; set; } #The caption of the positive answer; null uses the labels.
public string? NoText { get; set; } #The caption of the negative answer; null uses the labels.
Inherited Properties
public string Title { get; set; } #public string? Description { get; set; } #public string? ParameterName { get; set; } #public bool HasDefault { get; } #Extension Methods
public static ConfirmPrompt Default(ConfirmPrompt confirmPrompt, bool value = true) #Sets Prompt<bool>.Default: The default answer: pre-selected, accepted with Enter, and returned in non-interactive sessions.
Parameters
- confirmPrompt ConsoleMonster.Interactive.ConfirmPrompt
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
confirmPrompt.Default = value; Ui.ConfirmPrompt().Default(value);public static ConfirmPrompt Description(ConfirmPrompt confirmPrompt, string? value) #Sets Prompt<bool>.Description: Help text under the question.
Parameters
- confirmPrompt ConsoleMonster.Interactive.ConfirmPrompt
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
confirmPrompt.Description = value; Ui.ConfirmPrompt().Description(value);public static ConfirmPrompt Destructive(ConfirmPrompt confirmPrompt, bool value = true) #Sets ConfirmPrompt.Destructive: Marks the question as destructive: a warning mark, and No is focused unless the default says otherwise.
Parameters
- confirmPrompt ConsoleMonster.Interactive.ConfirmPrompt
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
confirmPrompt.Destructive = value; Ui.ConfirmPrompt().Destructive(value);public static ConfirmPrompt NoText(ConfirmPrompt confirmPrompt, string? value) #Sets ConfirmPrompt.NoText: The caption of the negative answer; null uses the labels.
Parameters
- confirmPrompt ConsoleMonster.Interactive.ConfirmPrompt
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
confirmPrompt.NoText = value; Ui.ConfirmPrompt().NoText(value);public static ConfirmPrompt ParameterName(ConfirmPrompt confirmPrompt, string? value) #Sets Prompt<bool>.ParameterName: The parameter that supplies this value non-interactively (-Domain, --domain); named in the non-interactive error message.
Parameters
- confirmPrompt ConsoleMonster.Interactive.ConfirmPrompt
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
confirmPrompt.ParameterName = value; Ui.ConfirmPrompt().ParameterName(value);public static ConfirmPrompt Title(ConfirmPrompt confirmPrompt, string value) #Sets Prompt<bool>.Title: The question.
Parameters
- confirmPrompt ConsoleMonster.Interactive.ConfirmPrompt
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
confirmPrompt.Title = value; Ui.ConfirmPrompt().Title(value);public static ConfirmPrompt YesText(ConfirmPrompt confirmPrompt, string? value) #Sets ConfirmPrompt.YesText: The caption of the positive answer; null uses the labels.
Parameters
- confirmPrompt ConsoleMonster.Interactive.ConfirmPrompt
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
confirmPrompt.YesText = value; Ui.ConfirmPrompt().YesText(value);