Field
ConsoleMonster.Interactive
A form field: a name (the key in FormValues), a label, help, a default, validation, a condition for showing it, the fields it depends on, and the command-line parameter it maps to for the equivalent command.
Inheritance
- object
- Field
Derived Types
Usage
Explore 7 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 3
- Method Form.Find
- Property Form.Fields
- Property FormPage.Fields
Accepted by parameters 4
- Extension method FormPage.Field
- Extension method FormPage.Fields
- Method FormPageFluent.Field
- Method FormPageFluent.Fields
Methods
public virtual string Display(object? value, PromptLabels labels) #The value as shown in the form and on the review page.
Parameters
- value object?
- The value.
- labels ConsoleMonster.Interactive.PromptLabels
- The labels.
Returns
string The text.public override string ToString() #Returns a string that represents the current object.
Returns
string A string that represents the current object.Inherited Methods
Properties
public string? ParameterName { get; set; } #The command-line parameter this field supplies (Domain, -Domain, --domain); null leaves the field out of the equivalent command.
public object? Default { get; set; } #The declared default: the starting value until a value is set, and values equal to it are left out of the equivalent command.
public Func<FormValues, bool>? VisibleWhen { get; set; } #Fluent("ShowWhen")Shows the field only while this returns true.
public IList<string> DependsOn { get; } #Fields whose change resets this field (and reloads its options).
public Func<object?, FormValues, string?>? Validator { get; set; } #Fluent("Validate")A validator: returns an error message, or null when the value is fine.
public bool Remember { get; set; } #Whether the value is kept in presets and remembered choices (never for secrets).
public abstract FieldKind Kind { get; } #The kind.