Skip to content
ConsoleMonster
Class

TextPromptFluent

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
static
Attributes
GeneratedCode("ConsoleMonster.Generators", "1.0.0")

The fluent methods of TextPrompt, generated from its public properties: A property-named method sets a property and Add... adds to a collection, both returning the same instance.

Inheritance

  • object
  • TextPromptFluent

Methods

AddHistory 3 overloads
public static TextPrompt AddHistory(TextPrompt textPrompt, string item) #

Adds an item to TextPrompt.History: Earlier answers offered with Up and Down (oldest first).

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
item string required
The item.

Returns

TextPrompt The same instance.
public static TextPrompt AddHistory(TextPrompt textPrompt, params string[] items) #

Adds items to TextPrompt.History: Earlier answers offered with Up and Down (oldest first).

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
items string[] required
The items, in order.

Returns

TextPrompt The same instance.
public static TextPrompt AddHistory(TextPrompt textPrompt, IEnumerable<string> items) #

Adds items to TextPrompt.History: Earlier answers offered with Up and Down (oldest first).

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
items System.Collections.Generic.IEnumerable<string> required
The items, in order.

Returns

TextPrompt The same instance.
public static TextPrompt Configure(TextPrompt textPrompt, Action<TextPrompt> configure) #

Assigns callbacks and related configuration without invoking delegate-valued properties.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
configure System.Action<ConsoleMonster.Interactive.TextPrompt> required
Assignments applied in order.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property    // C# fluent
textPrompt.Validator = value;    Ui.TextPrompt().Configure(configured => configured.Validator = value);
public static TextPrompt Default(TextPrompt textPrompt, string value) #

Sets Prompt<string>.Default: The default answer: pre-selected, accepted with Enter, and returned in non-interactive sessions.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value string required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property    // C# fluent
textPrompt.Default = value;      Ui.TextPrompt().Default(value);
public static TextPrompt Description(TextPrompt textPrompt, string? value) #

Sets Prompt<string>.Description: Help text under the question.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value string? required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property      // C# fluent
textPrompt.Description = value;    Ui.TextPrompt().Description(value);
public static TextPrompt MaxLength(TextPrompt textPrompt, int value) #

Sets TextPrompt.MaxLength: The most characters the box takes.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value int required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property    // C# fluent
textPrompt.MaxLength = value;    Ui.TextPrompt().MaxLength(value);
public static TextPrompt MinLength(TextPrompt textPrompt, int value) #

Sets TextPrompt.MinLength: The fewest characters accepted.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value int required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property    // C# fluent
textPrompt.MinLength = value;    Ui.TextPrompt().MinLength(value);
public static TextPrompt ParameterName(TextPrompt textPrompt, string? value) #

Sets Prompt<string>.ParameterName: The parameter that supplies this value non-interactively (-Domain, --domain); named in the non-interactive error message.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value string? required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property        // C# fluent
textPrompt.ParameterName = value;    Ui.TextPrompt().ParameterName(value);
public static TextPrompt Pattern(TextPrompt textPrompt, string? value) #

Sets TextPrompt.Pattern: A pattern the whole answer must match.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value string? required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property    // C# fluent
textPrompt.Pattern = value;      Ui.TextPrompt().Pattern(value);
public static TextPrompt PatternMessage(TextPrompt textPrompt, string? value) #

Sets TextPrompt.PatternMessage: The message when TextPrompt.Pattern does not match.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value string? required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property         // C# fluent
textPrompt.PatternMessage = value;    Ui.TextPrompt().PatternMessage(value);
public static TextPrompt Placeholder(TextPrompt textPrompt, string? value) #

Sets TextPrompt.Placeholder: Muted text in the empty box.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value string? required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property      // C# fluent
textPrompt.Placeholder = value;    Ui.TextPrompt().Placeholder(value);
PrefillDefault 2 overloads
public static TextPrompt PrefillDefault(TextPrompt textPrompt, bool value) #

Sets TextPrompt.PrefillDefault: Starts with the default in the box (editable) instead of showing it as a hint.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value bool required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property         // C# fluent
textPrompt.PrefillDefault = value;    Ui.TextPrompt().PrefillDefault(value);
public static TextPrompt PrefillDefault(TextPrompt textPrompt) #

Sets TextPrompt.PrefillDefault to true.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance to configure.

Returns

TextPrompt The same instance.
Required 2 overloads
public static TextPrompt Required(TextPrompt textPrompt, bool value) #

Sets TextPrompt.Required: Whether an empty answer is refused (when there is no default).

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value bool required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property    // C# fluent
textPrompt.Required = value;     Ui.TextPrompt().Required(value);
public static TextPrompt Required(TextPrompt textPrompt) #

Sets TextPrompt.Required to true.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance to configure.

Returns

TextPrompt The same instance.
public static TextPrompt Title(TextPrompt textPrompt, string value) #

Sets Prompt<string>.Title: The question.

Parameters

textPrompt ConsoleMonster.Interactive.TextPrompt required
The instance.
value string required
The value.

Returns

TextPrompt The same instance.

Examples

// C# initializer or property    // C# fluent
textPrompt.Title = value;        Ui.TextPrompt().Title(value);