Skip to content
ConsoleMonster
Class

ChoiceFluent

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
static
Attributes
GeneratedCode("ConsoleMonster.Generators", "1.0.0")

The fluent methods of Choice, generated from its public properties: A property-named method sets a property and Add... adds to a collection, both returning the same instance.

Inheritance

  • object
  • ChoiceFluent

Methods

Badge 2 overloads
public static Choice Badge(Choice choice, RichText? value) #

Sets Choice.Badge: Short right-aligned text: a count, a state, a tag ("new", "24 tasks").

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value ConsoleMonster.Text.RichText? required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property    // C# fluent
choice.Badge = value;            choice.Badge(value);
public static Choice Badge(Choice choice, Action<RichText> configure) #

Configures Choice.Badge in place: Short right-aligned text: a count, a state, a tag ("new", "24 tasks").

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
configure System.Action<ConsoleMonster.Text.RichText> required
Configures the value.

Returns

Choice The same instance.
public static Choice Description(Choice choice, string? value) #

Sets Choice.Description: A sentence shown under the list while the choice has focus.

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value string? required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property    // C# fluent
choice.Description = value;      choice.Description(value);
public static Choice DisabledReason(Choice choice, string? value) #

Sets Choice.DisabledReason: Why the choice cannot be picked; null when it can. Disabled choices are dimmed and show the reason on focus.

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value string? required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property     // C# fluent
choice.DisabledReason = value;    choice.DisabledReason(value);
public static Choice Group(Choice choice, string? value) #

Sets Choice.Group: The group heading the choice is listed under.

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value string? required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property    // C# fluent
choice.Group = value;            choice.Group(value);
public static Choice Hotkey(Choice choice, char? value) #

Sets Choice.Hotkey: A key that picks the choice directly (letters and digits).

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value char? required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property    // C# fluent
choice.Hotkey = value;           choice.Hotkey(value);
public static Choice Label(Choice choice, string value) #

Sets Choice.Label: The title, also what the filter matches.

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value string required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property    // C# fluent
choice.Label = value;            choice.Label(value);
public static Choice Preview(Choice choice, IWidget? value) #

Sets Choice.Preview: Content for the preview pane while the choice has focus (overrides the prompt's preview function).

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value ConsoleMonster.Layout.IWidget? required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property    // C# fluent
choice.Preview = value;          choice.Preview(value);
RichTitle 2 overloads
public static Choice RichTitle(Choice choice, RichText? value) #

Sets Choice.RichTitle: A styled title shown instead of Choice.Label while no filter is active.

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value ConsoleMonster.Text.RichText? required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property    // C# fluent
choice.RichTitle = value;        choice.RichTitle(value);
public static Choice RichTitle(Choice choice, Action<RichText> configure) #

Configures Choice.RichTitle in place: A styled title shown instead of Choice.Label while no filter is active.

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
configure System.Action<ConsoleMonster.Text.RichText> required
Configures the value.

Returns

Choice The same instance.
Selected 2 overloads
public static Choice Selected(Choice choice, bool value) #

Sets Choice.Selected: Whether a multi-selection starts with this choice selected.

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value bool required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property    // C# fluent
choice.Selected = value;         choice.Selected(value);
public static Choice Selected(Choice choice) #

Sets Choice.Selected to true.

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance to configure.

Returns

Choice The same instance.
public static Choice Tag(Choice choice, object? value) #

Sets Choice.Tag: Any extra object for the caller.

Parameters

choice ConsoleMonster.Interactive.Choice required
The instance.
value object? required
The value.

Returns

Choice The same instance.

Examples

// C# initializer or property    // C# fluent
choice.Tag = value;              choice.Tag(value);