Skip to content
ConsoleMonster
Class

FormPage

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
sealed

A page of a form.

Inheritance

  • object
  • FormPage

Usage

Explore 23 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 10

Accepted by parameters 13

Constructors

public FormPage(string title) #

Creates a page.

Parameters

title string required
The title.

Methods

public T Add<T>(T field) #

Adds a field.

Type Parameters

T

Parameters

field T required
The field.

Returns

T The field.
public ChoiceField MultiSelect(string key, string? label = null, IEnumerable<Choice>? choices = null) #

Adds a multi-choice field.

Parameters

key string required
The key.
label string? = null optional
The label.
choices System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.Choice>? = null optional
The choices.

Returns

ChoiceField The field.
public NumberField Number(string key, string? label = null) #

Adds a number field.

Parameters

key string required
The key.
label string? = null optional
The label.

Returns

NumberField The field.
public PathField Path(string key, string? label = null) #

Adds a path field.

Parameters

key string required
The key.
label string? = null optional
The label.

Returns

PathField The field.
public SecretField Secret(string key, string? label = null) #

Adds a secret field.

Parameters

key string required
The key.
label string? = null optional
The label.

Returns

SecretField The field.
public ChoiceField Select(string key, string? label = null, IEnumerable<Choice>? choices = null) #

Adds a single-choice field.

Parameters

key string required
The key.
label string? = null optional
The label.
choices System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.Choice>? = null optional
The choices.

Returns

ChoiceField The field.
public TextField Text(string key, string? label = null) #

Adds a text field.

Parameters

key string required
The key.
label string? = null optional
The label.

Returns

TextField The field.
public TextAreaField TextArea(string key, string? label = null) #

Adds a field for several lines of text.

Parameters

key string required
The key.
label string? = null optional
The label.

Returns

TextAreaField The field.
public ToggleField Toggle(string key, string? label = null) #

Adds a toggle.

Parameters

key string required
The key.
label string? = null optional
The label.

Returns

ToggleField The field.

Properties

public string Title { get; set; } #

The title (also shown in the progress strip).

public string? Description { get; set; } #

A sentence under the title.

public IList<Field> Fields { get; } #

The fields.

Extension Methods

public static FormPage Description(FormPage formPage, string? value) #

Sets FormPage.Description: A sentence under the title.

Parameters

formPage ConsoleMonster.Interactive.FormPage required
The instance.
value string? required
The value.

Returns

FormPage The same instance.

Examples

// C# initializer or property    // C# fluent
formPage.Description = value;    formPage.Description(value);
public static FormPage Field(FormPage formPage, Field item) #

Adds an item to FormPage.Fields: The fields.

Parameters

formPage ConsoleMonster.Interactive.FormPage required
The instance.
item ConsoleMonster.Interactive.Field required
The item.

Returns

FormPage The same instance.
public static FormPage Fields(FormPage formPage, IEnumerable<Field> items) #

Adds items to FormPage.Fields: The fields.

Parameters

formPage ConsoleMonster.Interactive.FormPage required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Interactive.Field> required
The items, in order.

Returns

FormPage The same instance.
public static FormPage Title(FormPage formPage, string value) #

Sets FormPage.Title: The title (also shown in the progress strip).

Parameters

formPage ConsoleMonster.Interactive.FormPage required
The instance.
value string required
The value.

Returns

FormPage The same instance.

Examples

// C# initializer or property    // C# fluent
formPage.Title = value;          formPage.Title(value);