FieldFluent
ConsoleMonster.Interactive
The fluent methods of Field, 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
- FieldFluent
Methods
public static TSelf AddDependsOn<TSelf>(TSelf field, string item) #Adds an item to Field.DependsOn: Fields whose change resets this field (and reloads its options).
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- item string
- The item.
Returns
TSelf The same instance.public static TSelf AddDependsOn<TSelf>(TSelf field, params string[] items) #Adds items to Field.DependsOn: Fields whose change resets this field (and reloads its options).
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- items string[]
- The items, in order.
Returns
TSelf The same instance.public static TSelf AddDependsOn<TSelf>(TSelf field, IEnumerable<string> items) #Adds items to Field.DependsOn: Fields whose change resets this field (and reloads its options).
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- items System.Collections.Generic.IEnumerable<string>
- The items, in order.
Returns
TSelf The same instance.public static TSelf Configure<TSelf>(TSelf field, Action<TSelf> configure) #Assigns callbacks and related configuration without invoking delegate-valued properties.
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- configure System.Action<TSelf>
- Assignments applied in order.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
@field.VisibleWhen = value; @field.Configure(configured => configured.VisibleWhen = value);// C# initializer or property // C# fluent
@field.Validator = value; @field.Configure(configured => configured.Validator = value);public static TSelf Default<TSelf>(TSelf field, 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.
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- value object?
- The value.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
@field.Default = value; @field.Default(value);public static TSelf Help<TSelf>(TSelf field, string? value) #Sets Field.Help: Help shown while the field has focus.
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- value string?
- The value.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
@field.Help = value; @field.Help(value);public static TSelf Label<TSelf>(TSelf field, string value) #Sets Field.Label: The label.
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- value string
- The value.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
@field.Label = value; @field.Label(value);public static TSelf ParameterName<TSelf>(TSelf field, string? value) #Sets Field.ParameterName: The command-line parameter this field supplies (Domain, -Domain, --domain); null leaves the field out of the equivalent command.
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- value string?
- The value.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
@field.ParameterName = value; @field.ParameterName(value);public static TSelf Remember<TSelf>(TSelf field, bool value) #Sets Field.Remember: Whether the value is kept in presets and remembered choices (never for secrets).
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- value bool
- The value.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
@field.Remember = value; @field.Remember(value);public static TSelf Remember<TSelf>(TSelf field) #Sets Field.Remember to true.
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance to configure.
Returns
TSelf The same instance.public static TSelf Required<TSelf>(TSelf field, bool value) #Sets Field.Required: Whether an empty value is refused.
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- value bool
- The value.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
@field.Required = value; @field.Required(value);public static TSelf Required<TSelf>(TSelf field) #Sets Field.Required to true.
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance to configure.
Returns
TSelf The same instance.public static TSelf Value<TSelf>(TSelf field, object? value) #Sets Field.Value: The current value.
Type Parameters
- TSelf
Parameters
- field TSelf
- The instance.
- value object?
- The value.
Returns
TSelf The same instance.Examples
// C# initializer or property // C# fluent
@field.Value = value; @field.Value(value);