Skip to content
ConsoleMonster
Class

FormOptions

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
sealed
Attributes
Fluent

How a form is shown on its own.

Inheritance

  • object
  • FormOptions

Usage

Explore 33 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.

Accepted by parameters 18

Constructors

public FormOptions() #

Methods

public FormOptions Clone() #

Copies this configuration; explicitly supplied nested devices and callbacks remain shared.

Returns

FormOptions A distinct options object with the same values.

Properties

public InteractiveOptions? Interactive { get; set; } #

Interaction settings (mode, input, profile, theme, labels).

public string? AppName { get; set; } #

The app name presets and remembered choices are stored under; null disables both.

public bool RememberLastChoices { get; set; } #

Whether the last submitted values are remembered and offered next time (opt-in).

public string? StorageRoot { get; set; } #

The folder for the app's storage folder; null uses the per-user default.

public bool Inline { get; set; } #

Draws the form in the scrollback instead of on the alternate screen.

public string? Preset { get; set; } #

A preset to apply before showing.

public Action<MenuContext>? AfterSubmit { get; set; } #
Fluent("WhenSubmitted")

Called with the submitted values (on the form's screen, full-screen mode): call context.Run(dashboard, work) to run the work with a live dashboard in the form's own frame, ending on a results summary, so the last step, the run and the result read as one screen. The run's result is on FormResult.RunResult.

Extension Methods

public static FormOptions AppName(FormOptions formOptions, string? value) #

Sets FormOptions.AppName: The app name presets and remembered choices are stored under; null disables both.

Parameters

formOptions ConsoleMonster.Interactive.FormOptions required
The instance.
value string? required
The value.

Returns

FormOptions The same instance.

Examples

// C# initializer or property                                              // C# fluent
new global::ConsoleMonster.Interactive.FormOptions { AppName = value };    formOptions.AppName(value);
public static FormOptions Inline(FormOptions formOptions, bool value = true) #

Sets FormOptions.Inline: Draws the form in the scrollback instead of on the alternate screen.

Parameters

formOptions ConsoleMonster.Interactive.FormOptions required
The instance.
value bool = true optional
The value; true when omitted.

Returns

FormOptions The same instance.

Examples

// C# initializer or property                                             // C# fluent
new global::ConsoleMonster.Interactive.FormOptions { Inline = value };    formOptions.Inline(value);
Interactive 2 overloads
public static FormOptions Interactive(FormOptions formOptions, InteractiveOptions? value) #

Sets FormOptions.Interactive: Interaction settings (mode, input, profile, theme, labels).

Parameters

formOptions ConsoleMonster.Interactive.FormOptions required
The instance.
value ConsoleMonster.Interactive.InteractiveOptions? required
The value.

Returns

FormOptions The same instance.

Examples

// C# initializer or property                                                  // C# fluent
new global::ConsoleMonster.Interactive.FormOptions { Interactive = value };    formOptions.Interactive(value);
public static FormOptions Interactive(FormOptions formOptions, Action<InteractiveOptions> configure) #

Configures FormOptions.Interactive in place (creating it when not set): Interaction settings (mode, input, profile, theme, labels).

Parameters

formOptions ConsoleMonster.Interactive.FormOptions required
The instance.
configure System.Action<ConsoleMonster.Interactive.InteractiveOptions> required
Configures the value.

Returns

FormOptions The same instance.
public static FormOptions Preset(FormOptions formOptions, string? value) #

Sets FormOptions.Preset: A preset to apply before showing.

Parameters

formOptions ConsoleMonster.Interactive.FormOptions required
The instance.
value string? required
The value.

Returns

FormOptions The same instance.

Examples

// C# initializer or property                                             // C# fluent
new global::ConsoleMonster.Interactive.FormOptions { Preset = value };    formOptions.Preset(value);
public static FormOptions RememberLastChoices(FormOptions formOptions, bool value = true) #

Sets FormOptions.RememberLastChoices: Whether the last submitted values are remembered and offered next time (opt-in).

Parameters

formOptions ConsoleMonster.Interactive.FormOptions required
The instance.
value bool = true optional
The value; true when omitted.

Returns

FormOptions The same instance.

Examples

// C# initializer or property                                                          // C# fluent
new global::ConsoleMonster.Interactive.FormOptions { RememberLastChoices = value };    formOptions.RememberLastChoices(value);
public static FormOptions StorageRoot(FormOptions formOptions, string? value) #

Sets FormOptions.StorageRoot: The folder for the app's storage folder; null uses the per-user default.

Parameters

formOptions ConsoleMonster.Interactive.FormOptions required
The instance.
value string? required
The value.

Returns

FormOptions The same instance.

Examples

// C# initializer or property                                                  // C# fluent
new global::ConsoleMonster.Interactive.FormOptions { StorageRoot = value };    formOptions.StorageRoot(value);
public static FormOptions WhenSubmitted(FormOptions formOptions, Action<MenuContext>? value) #

Sets FormOptions.AfterSubmit: Called with the submitted values (on the form's screen, full-screen mode): call context.Run(dashboard, work) to run the work with a live dashboard in the form's own frame, ending on a results summary, so the last step, the run and the result read as one screen. The run's result is on FormResult.RunResult.

Parameters

formOptions ConsoleMonster.Interactive.FormOptions required
The instance.
value System.Action<ConsoleMonster.Interactive.MenuContext>? required
The callback.

Returns

FormOptions The same instance.

Examples

// C# initializer or property                                                  // C# fluent
new global::ConsoleMonster.Interactive.FormOptions { AfterSubmit = value };    formOptions.WhenSubmitted(value);