Skip to content
ConsoleMonster

API Reference

Class

ToggleField

Namespace ConsoleMonster.Interactive
Assembly ConsoleMonster
Base Field
Modifiers sealed

An on/off switch (a switch parameter in the equivalent command).

Inheritance

Usage

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

Constructors

public ToggleField(String name, String? label = null) #

Creates a toggle.

Parameters

name System.String requiredposition: 0
The key.
label System.String? = null optionalposition: 1
The label.

Methods

public override 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.

Properties

public override FieldKind Kind { get; } #

The kind.

public String? OnText { get; set; } #

Text after the box when on; null uses "Yes".

public String? OffText { get; set; } #

Text after the box when off; null uses "No".