SecretField
ConsoleMonster.Interactive
A secret: masked in the form, never shown on the review page, never stored, a placeholder in the command.
Inheritance
- Field
- SecretField
Usage
Explore 50 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 26
- Method Form.Secret
- Method FormPage.Secret
- Extension method SecretField.CommandPlaceholder
- Extension method SecretField.Default
- Extension method SecretField.DependsOn
- Extension method SecretField.Help
- Extension method SecretField.Label
- Extension method SecretField.MinLength
- Extension method SecretField.ParameterName
- Extension method SecretField.Remember
- Extension method SecretField.Required
- Extension method SecretField.ShowWhen
- Extension method SecretField.Validate
- Extension method SecretField.Value
- Method SecretFieldFluent.CommandPlaceholder
- Method SecretFieldFluent.Default
- Method SecretFieldFluent.DependsOn
- Method SecretFieldFluent.Help
- Method SecretFieldFluent.Label
- Method SecretFieldFluent.MinLength
- Method SecretFieldFluent.ParameterName
- Method SecretFieldFluent.Remember
- Method SecretFieldFluent.Required
- Method SecretFieldFluent.ShowWhen
- Method SecretFieldFluent.Validate
- Method SecretFieldFluent.Value
Accepted by parameters 24
- Extension method SecretField.CommandPlaceholder
- Extension method SecretField.Default
- Extension method SecretField.DependsOn
- Extension method SecretField.Help
- Extension method SecretField.Label
- Extension method SecretField.MinLength
- Extension method SecretField.ParameterName
- Extension method SecretField.Remember
- Extension method SecretField.Required
- Extension method SecretField.ShowWhen
- Extension method SecretField.Validate
- Extension method SecretField.Value
- Method SecretFieldFluent.CommandPlaceholder
- Method SecretFieldFluent.Default
- Method SecretFieldFluent.DependsOn
- Method SecretFieldFluent.Help
- Method SecretFieldFluent.Label
- Method SecretFieldFluent.MinLength
- Method SecretFieldFluent.ParameterName
- Method SecretFieldFluent.Remember
- Method SecretFieldFluent.Required
- Method SecretFieldFluent.ShowWhen
- Method SecretFieldFluent.Validate
- Method SecretFieldFluent.Value
Constructors
public SecretField(string key, string? label = null) #Creates a secret field.
Parameters
- key string
- The key.
- label string? = null
- 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?
- The value.
- labels ConsoleMonster.Interactive.PromptLabels
- The labels.
Returns
string The text.Inherited Methods
Properties
public string CommandPlaceholder { get; set; } #What stands in for the secret in the equivalent command (PowerShell: (Read-Host -AsSecureString)).
Inherited Properties
Extension Methods
public static SecretField CommandPlaceholder(SecretField secretField, string value) #Sets SecretField.CommandPlaceholder: What stands in for the secret in the equivalent command (PowerShell: (Read-Host -AsSecureString)).
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
secretField.CommandPlaceholder = value; secretField.CommandPlaceholder(value);public static SecretField Default(SecretField secretField, 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
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value object?
- The value.
Examples
// C# initializer or property // C# fluent
secretField.Default = value; secretField.Default(value);public static SecretField DependsOn(SecretField secretField, string item) #Adds an item to Field.DependsOn: Fields whose change resets this field (and reloads its options).
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- item string
- The item.
public static SecretField DependsOn(SecretField secretField, IEnumerable<string> items) #Adds items to Field.DependsOn: Fields whose change resets this field (and reloads its options).
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- items System.Collections.Generic.IEnumerable<string>
- The items, in order.
public static SecretField Help(SecretField secretField, string? value) #Sets Field.Help: Help shown while the field has focus.
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
secretField.Help = value; secretField.Help(value);public static SecretField Label(SecretField secretField, string value) #Sets Field.Label: The label.
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
secretField.Label = value; secretField.Label(value);public static SecretField MinLength(SecretField secretField, int value) #Sets SecretField.MinLength: The fewest characters.
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
secretField.MinLength = value; secretField.MinLength(value);public static SecretField ParameterName(SecretField secretField, 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
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
secretField.ParameterName = value; secretField.ParameterName(value);public static SecretField Remember(SecretField secretField, bool value = true) #Sets Field.Remember: Whether the value is kept in presets and remembered choices (never for secrets).
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
secretField.Remember = value; secretField.Remember(value);public static SecretField Required(SecretField secretField, bool value = true) #Sets Field.Required: Whether an empty value is refused.
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
secretField.Required = value; secretField.Required(value);public static SecretField ShowWhen(SecretField secretField, Func<FormValues, bool>? value) #Sets Field.VisibleWhen: Shows the field only while this returns true.
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value System.Func<ConsoleMonster.Interactive.FormValues, bool>?
- The callback.
Examples
// C# initializer or property // C# fluent
secretField.VisibleWhen = value; secretField.ShowWhen(value);public static SecretField Validate(SecretField secretField, Func<object?, FormValues, string?>? value) #Sets Field.Validator: A validator: returns an error message, or null when the value is fine.
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value System.Func<object?, ConsoleMonster.Interactive.FormValues, string?>?
- The callback.
Examples
// C# initializer or property // C# fluent
secretField.Validator = value; secretField.Validate(value);public static SecretField Value(SecretField secretField, object? value) #Sets Field.Value: The current value.
Parameters
- secretField ConsoleMonster.Interactive.SecretField
- The instance.
- value object?
- The value.
Examples
// C# initializer or property // C# fluent
secretField.Value = value; secretField.Value(value);