DatePrompt
ConsoleMonster.Interactive
Asks for one civil DateTime or, with Range, one inclusive DateRange. Cancellation follows the shared prompt policy.
Inheritance
- Prompt<object>
- DatePrompt
Usage
Explore 25 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 13
- Extension method DatePrompt.Default
- Extension method DatePrompt.Description
- Extension method DatePrompt.ParameterName
- Extension method DatePrompt.Range
- Extension method DatePrompt.Selection
- Extension method DatePrompt.Title
- Method DatePromptFluent.Default
- Method DatePromptFluent.Description
- Method DatePromptFluent.ParameterName
- Method DatePromptFluent.Range
- Method DatePromptFluent.Selection
- Method DatePromptFluent.Title
- Method Ui.DatePrompt
Accepted by parameters 12
- Extension method DatePrompt.Default
- Extension method DatePrompt.Description
- Extension method DatePrompt.ParameterName
- Extension method DatePrompt.Range
- Extension method DatePrompt.Selection
- Extension method DatePrompt.Title
- Method DatePromptFluent.Default
- Method DatePromptFluent.Description
- Method DatePromptFluent.ParameterName
- Method DatePromptFluent.Range
- Method DatePromptFluent.Selection
- Method DatePromptFluent.Title
Constructors
Methods
public override string Describe(object value) #The answer as text, for the summary line left in the scrollback.
Parameters
- value object
- The answer.
Returns
string The text.public override object Show(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Asks the question and returns the answer.
Parameters
- options ConsoleMonster.Interactive.InteractiveOptions? = null
- Options; null uses InteractiveOptions.Default.
- cancellationToken System.Threading.CancellationToken = default
- Cancels the prompt.
Returns
object The answer.Exceptions
PromptCanceledException– The user cancelled.PromptUnavailableException– Nobody can answer and there is no default.
Inherited Methods
public Task<object> ShowAsync(InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
Task<object>public IWidget Snapshot(InteractiveOptions? options = null) #Parameters
- options InteractiveOptions? = null
Returns
IWidgetpublic bool TryShow(out object value, InteractiveOptions? options = null, CancellationToken cancellationToken = default) #Parameters
- value object
- options InteractiveOptions? = null
- cancellationToken CancellationToken = default
Returns
boolProperties
public DateSelectionOptions Selection { get; set; } #Date bounds, unavailable dates, culture and marked-day data.
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 DatePrompt Default(DatePrompt datePrompt, object value) #Sets Prompt<object>.Default: The default answer: pre-selected, accepted with Enter, and returned in non-interactive sessions.
Parameters
- datePrompt ConsoleMonster.Interactive.DatePrompt
- The instance.
- value object
- The value.
Examples
// C# initializer or property // C# fluent
datePrompt.Default = value; Ui.DatePrompt().Default(value);public static DatePrompt Description(DatePrompt datePrompt, string? value) #Sets Prompt<object>.Description: Help text under the question.
Parameters
- datePrompt ConsoleMonster.Interactive.DatePrompt
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
datePrompt.Description = value; Ui.DatePrompt().Description(value);public static DatePrompt ParameterName(DatePrompt datePrompt, string? value) #Sets Prompt<object>.ParameterName: The parameter that supplies this value non-interactively (-Domain, --domain); named in the non-interactive error message.
Parameters
- datePrompt ConsoleMonster.Interactive.DatePrompt
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
datePrompt.ParameterName = value; Ui.DatePrompt().ParameterName(value);public static DatePrompt Range(DatePrompt datePrompt, bool value) #Sets DatePrompt.Range: Returns one DateRange instead of a DateTime.
Parameters
- datePrompt ConsoleMonster.Interactive.DatePrompt
- The instance.
- value bool
- The value.
Examples
// C# initializer or property // C# fluent
datePrompt.Range = value; Ui.DatePrompt().Range(value);public static DatePrompt Range(DatePrompt datePrompt) #Sets DatePrompt.Range to true.
Parameters
- datePrompt ConsoleMonster.Interactive.DatePrompt
- The instance to configure.
public static DatePrompt Selection(DatePrompt datePrompt, DateSelectionOptions value) #Sets DatePrompt.Selection: Date bounds, unavailable dates, culture and marked-day data.
Parameters
- datePrompt ConsoleMonster.Interactive.DatePrompt
- The instance.
- value ConsoleMonster.Interactive.DateSelectionOptions
- The value.
Examples
// C# initializer or property // C# fluent
datePrompt.Selection = value; Ui.DatePrompt().Selection(value);public static DatePrompt Selection(DatePrompt datePrompt, Action<DateSelectionOptions> configure) #Configures DatePrompt.Selection in place (creating it when not set): Date bounds, unavailable dates, culture and marked-day data.
Parameters
- datePrompt ConsoleMonster.Interactive.DatePrompt
- The instance.
- configure System.Action<ConsoleMonster.Interactive.DateSelectionOptions>
- Configures the value.
public static DatePrompt Title(DatePrompt datePrompt, string value) #Sets Prompt<object>.Title: The question.
Parameters
- datePrompt ConsoleMonster.Interactive.DatePrompt
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
datePrompt.Title = value; Ui.DatePrompt().Title(value);