TextField
ConsoleMonster.Interactive
A line of text.
Inheritance
- Field
- TextField
Usage
Explore 62 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 32
- Method Form.Text
- Method FormPage.Text
- Extension method TextField.Default
- Extension method TextField.DependsOn
- Extension method TextField.Help
- Extension method TextField.Label
- Extension method TextField.MaxLength
- Extension method TextField.MinLength
- Extension method TextField.ParameterName
- Extension method TextField.Pattern
- Extension method TextField.PatternMessage
- Extension method TextField.Placeholder
- Extension method TextField.Remember
- Extension method TextField.Required
- Extension method TextField.ShowWhen
- Extension method TextField.Validate
- Extension method TextField.Value
- Method TextFieldFluent.Default
- Method TextFieldFluent.DependsOn
- Method TextFieldFluent.Help
- Method TextFieldFluent.Label
- Method TextFieldFluent.MaxLength
- Method TextFieldFluent.MinLength
- Method TextFieldFluent.ParameterName
- Method TextFieldFluent.Pattern
- Method TextFieldFluent.PatternMessage
- Method TextFieldFluent.Placeholder
- Method TextFieldFluent.Remember
- Method TextFieldFluent.Required
- Method TextFieldFluent.ShowWhen
- Method TextFieldFluent.Validate
- Method TextFieldFluent.Value
Accepted by parameters 30
- Extension method TextField.Default
- Extension method TextField.DependsOn
- Extension method TextField.Help
- Extension method TextField.Label
- Extension method TextField.MaxLength
- Extension method TextField.MinLength
- Extension method TextField.ParameterName
- Extension method TextField.Pattern
- Extension method TextField.PatternMessage
- Extension method TextField.Placeholder
- Extension method TextField.Remember
- Extension method TextField.Required
- Extension method TextField.ShowWhen
- Extension method TextField.Validate
- Extension method TextField.Value
- Method TextFieldFluent.Default
- Method TextFieldFluent.DependsOn
- Method TextFieldFluent.Help
- Method TextFieldFluent.Label
- Method TextFieldFluent.MaxLength
- Method TextFieldFluent.MinLength
- Method TextFieldFluent.ParameterName
- Method TextFieldFluent.Pattern
- Method TextFieldFluent.PatternMessage
- Method TextFieldFluent.Placeholder
- Method TextFieldFluent.Remember
- Method TextFieldFluent.Required
- Method TextFieldFluent.ShowWhen
- Method TextFieldFluent.Validate
- Method TextFieldFluent.Value
Constructors
public TextField(string key, string? label = null) #Creates a text field.
Parameters
- key string
- The key.
- label string? = null
- The label.
Inherited Methods
Properties
public string? PatternMessage { get; set; } #The message when the pattern does not match.
Inherited Properties
Extension Methods
public static TextField Default(TextField textField, 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
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value object?
- The value.
Examples
// C# initializer or property // C# fluent
textField.Default = value; textField.Default(value);public static TextField DependsOn(TextField textField, string item) #Adds an item to Field.DependsOn: Fields whose change resets this field (and reloads its options).
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- item string
- The item.
public static TextField DependsOn(TextField textField, IEnumerable<string> items) #Adds items to Field.DependsOn: Fields whose change resets this field (and reloads its options).
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- items System.Collections.Generic.IEnumerable<string>
- The items, in order.
public static TextField Help(TextField textField, string? value) #Sets Field.Help: Help shown while the field has focus.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
textField.Help = value; textField.Help(value);public static TextField Label(TextField textField, string value) #Sets Field.Label: The label.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
textField.Label = value; textField.Label(value);public static TextField MaxLength(TextField textField, int value) #Sets TextField.MaxLength: The most characters.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
textField.MaxLength = value; textField.MaxLength(value);public static TextField MinLength(TextField textField, int value) #Sets TextField.MinLength: The fewest characters.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
textField.MinLength = value; textField.MinLength(value);public static TextField ParameterName(TextField textField, 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
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
textField.ParameterName = value; textField.ParameterName(value);public static TextField Pattern(TextField textField, string? value) #Sets TextField.Pattern: A pattern the whole value must match.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
textField.Pattern = value; textField.Pattern(value);public static TextField PatternMessage(TextField textField, string? value) #Sets TextField.PatternMessage: The message when the pattern does not match.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
textField.PatternMessage = value; textField.PatternMessage(value);public static TextField Placeholder(TextField textField, string? value) #Sets TextField.Placeholder: Muted text while empty.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
textField.Placeholder = value; textField.Placeholder(value);public static TextField Remember(TextField textField, bool value = true) #Sets Field.Remember: Whether the value is kept in presets and remembered choices (never for secrets).
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
textField.Remember = value; textField.Remember(value);public static TextField Required(TextField textField, bool value = true) #Sets Field.Required: Whether an empty value is refused.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
textField.Required = value; textField.Required(value);public static TextField ShowWhen(TextField textField, Func<FormValues, bool>? value) #Sets Field.VisibleWhen: Shows the field only while this returns true.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value System.Func<ConsoleMonster.Interactive.FormValues, bool>?
- The callback.
Examples
// C# initializer or property // C# fluent
textField.VisibleWhen = value; textField.ShowWhen(value);public static TextField Validate(TextField textField, Func<object?, FormValues, string?>? value) #Sets Field.Validator: A validator: returns an error message, or null when the value is fine.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value System.Func<object?, ConsoleMonster.Interactive.FormValues, string?>?
- The callback.
Examples
// C# initializer or property // C# fluent
textField.Validator = value; textField.Validate(value);public static TextField Value(TextField textField, object? value) #Sets Field.Value: The current value.
Parameters
- textField ConsoleMonster.Interactive.TextField
- The instance.
- value object?
- The value.
Examples
// C# initializer or property // C# fluent
textField.Value = value; textField.Value(value);