ChoiceFluent
ConsoleMonster.Interactive
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
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
- The instance.
- value ConsoleMonster.Text.RichText?
- The value.
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
- The instance.
- configure System.Action<ConsoleMonster.Text.RichText>
- Configures the value.
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
- The instance.
- value string?
- The value.
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
- The instance.
- value string?
- The value.
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
- The instance.
- value string?
- The value.
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
- The instance.
- value char?
- The value.
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
- The instance.
- value string
- The value.
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
- The instance.
- value ConsoleMonster.Layout.IWidget?
- The value.
Examples
// C# initializer or property // C# fluent
choice.Preview = value; choice.Preview(value);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
- The instance.
- value ConsoleMonster.Text.RichText?
- The value.
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
- The instance.
- configure System.Action<ConsoleMonster.Text.RichText>
- Configures the value.
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
- The instance.
- value bool
- The value.
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
- The instance to configure.
public static Choice Tag(Choice choice, object? value) #Sets Choice.Tag: Any extra object for the caller.
Parameters
- choice ConsoleMonster.Interactive.Choice
- The instance.
- value object?
- The value.
Examples
// C# initializer or property // C# fluent
choice.Tag = value; choice.Tag(value);