Skip to content
ConsoleMonster

API Reference

Class

Field

Namespace ConsoleMonster.Interactive
Assembly ConsoleMonster
Modifiers abstract

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

Usage

Explore 3 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

Methods

public virtual String Display(Object? value, PromptLabels labels) #
Returns: String

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

Parameters

value System.Object? requiredposition: 0
The value.
labels ConsoleMonster.Interactive.PromptLabels requiredposition: 1
The labels.

Returns

The text.

public override String ToString() #
Returns: String

Returns a string that represents the current object.

Returns

A string that represents the current object.

Properties

public String Name { get; } #

The key in the form values.

public String Label { get; set; } #

The label.

public String? Help { get; set; } #

Help shown while the field has focus.

public String? Parameter { get; set; } #

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

public Boolean Required { get; set; } #

Whether an empty value is refused.

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 Object? Value { get; set; } #

The current value.

public Func<FormValues, Boolean>? VisibleWhen { get; set; } #

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; } #

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

public Boolean Remember { get; set; } #

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

public abstract FieldKind Kind { get; } #

The kind.