Skip to content
ConsoleMonster
Class

TextAreaField

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Base
Field
Modifiers
sealed

Several lines of text (notes, change reasons). In a form it shows the first line and the number of further lines; Enter opens the text in a dialog with soft wrap, where Ctrl+Enter saves and Esc keeps the old value.

Inheritance

Usage

Explore 61 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.

Accepted by parameters 30

Constructors

public TextAreaField(string key, string? label = null) #

Creates the field.

Parameters

key string required
The key.
label string? = null optional
The label.

Methods

public override string Display(object? value, PromptLabels labels) #

The value as shown in the form and on the review page.

Parameters

value object? required
The value.
labels ConsoleMonster.Interactive.PromptLabels required
The labels.

Returns

string The text.

Properties

public override FieldKind Kind { get; } #

The kind.

public string? Placeholder { get; set; } #

Muted text while empty.

public int MinLength { get; set; } #

The fewest characters.

public int MaxLength { get; set; } #

The most characters.

public int MaxLines { get; set; } #

The most lines.

public int Height { get; set; } #

The visible rows of the editor (default 8).

Extension Methods

public static TextAreaField Default(TextAreaField textAreaField, object? value) #

Sets Field.Default: The declared default: the starting value until a value is set, and values equal to it are left out of the equivalent command.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value object? required
The value.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property     // C# fluent
textAreaField.Default = value;    textAreaField.Default(value);
DependsOn 2 overloads
public static TextAreaField DependsOn(TextAreaField textAreaField, string item) #

Adds an item to Field.DependsOn: Fields whose change resets this field (and reloads its options).

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
item string required
The item.

Returns

TextAreaField The same instance.
public static TextAreaField DependsOn(TextAreaField textAreaField, IEnumerable<string> items) #

Adds items to Field.DependsOn: Fields whose change resets this field (and reloads its options).

Parameters

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

Returns

TextAreaField The same instance.
public static TextAreaField Height(TextAreaField textAreaField, int value) #

Sets TextAreaField.Height: The visible rows of the editor (default 8).

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value int required
The value.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property    // C# fluent
textAreaField.Height = value;    textAreaField.Height(value);
public static TextAreaField Help(TextAreaField textAreaField, string? value) #

Sets Field.Help: Help shown while the field has focus.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value string? required
The value.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property    // C# fluent
textAreaField.Help = value;      textAreaField.Help(value);
public static TextAreaField Label(TextAreaField textAreaField, string value) #

Sets Field.Label: The label.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value string required
The value.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property    // C# fluent
textAreaField.Label = value;     textAreaField.Label(value);
public static TextAreaField MaxLength(TextAreaField textAreaField, int value) #

Sets TextAreaField.MaxLength: The most characters.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value int required
The value.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property       // C# fluent
textAreaField.MaxLength = value;    textAreaField.MaxLength(value);
public static TextAreaField MaxLines(TextAreaField textAreaField, int value) #

Sets TextAreaField.MaxLines: The most lines.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value int required
The value.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property      // C# fluent
textAreaField.MaxLines = value;    textAreaField.MaxLines(value);
public static TextAreaField MinLength(TextAreaField textAreaField, int value) #

Sets TextAreaField.MinLength: The fewest characters.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value int required
The value.

Returns

TextAreaField The same instance.

Examples

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

Sets Field.ParameterName: The command-line parameter this field supplies (Domain, -Domain, --domain); null leaves the field out of the equivalent command.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value string? required
The value.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property           // C# fluent
textAreaField.ParameterName = value;    textAreaField.ParameterName(value);
public static TextAreaField Placeholder(TextAreaField textAreaField, string? value) #

Sets TextAreaField.Placeholder: Muted text while empty.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value string? required
The value.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property         // C# fluent
textAreaField.Placeholder = value;    textAreaField.Placeholder(value);
public static TextAreaField Remember(TextAreaField textAreaField, bool value = true) #

Sets Field.Remember: Whether the value is kept in presets and remembered choices (never for secrets).

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property      // C# fluent
textAreaField.Remember = value;    textAreaField.Remember(value);
public static TextAreaField Required(TextAreaField textAreaField, bool value = true) #

Sets Field.Required: Whether an empty value is refused.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value bool = true optional
The value; true when omitted.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property      // C# fluent
textAreaField.Required = value;    textAreaField.Required(value);
public static TextAreaField ShowWhen(TextAreaField textAreaField, Func<FormValues, bool>? value) #

Sets Field.VisibleWhen: Shows the field only while this returns true.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value System.Func<ConsoleMonster.Interactive.FormValues, bool>? required
The callback.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property         // C# fluent
textAreaField.VisibleWhen = value;    textAreaField.ShowWhen(value);
public static TextAreaField Validate(TextAreaField textAreaField, Func<object?, FormValues, string?>? value) #

Sets Field.Validator: A validator: returns an error message, or null when the value is fine.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value System.Func<object?, ConsoleMonster.Interactive.FormValues, string?>? required
The callback.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property       // C# fluent
textAreaField.Validator = value;    textAreaField.Validate(value);
public static TextAreaField Value(TextAreaField textAreaField, object? value) #

Sets Field.Value: The current value.

Parameters

textAreaField ConsoleMonster.Interactive.TextAreaField required
The instance.
value object? required
The value.

Returns

TextAreaField The same instance.

Examples

// C# initializer or property    // C# fluent
textAreaField.Value = value;     textAreaField.Value(value);