Skip to content
ConsoleMonster
Class

KeyValueListFluent

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
static

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

Inheritance

  • object
  • KeyValueListFluent

Methods

public static KeyValueList Columns(KeyValueList keyValueList, int value) #

Sets KeyValueList.Columns: Preferred number of pairs per row; narrow layouts reduce the count automatically.

Parameters

keyValueList ConsoleMonster.Widgets.KeyValueList required
The instance.
value int required
The value.

Returns

KeyValueList The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ConsoleMonster.Widgets.KeyValueList { Columns = value };    Ui.KeyValue().Columns(value);
public static KeyValueList Gap(KeyValueList keyValueList, int value) #

Sets KeyValueList.Gap: Cells between the key column and the values (default 2).

Parameters

keyValueList ConsoleMonster.Widgets.KeyValueList required
The instance.
value int required
The value.

Returns

KeyValueList The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ConsoleMonster.Widgets.KeyValueList { Gap = value };    Ui.KeyValue().Gap(value);
public static KeyValueList KeyRole(KeyValueList keyValueList, ThemeToken value) #

Sets KeyValueList.KeyRole: Theme colour for keys.

Parameters

keyValueList ConsoleMonster.Widgets.KeyValueList required
The instance.
value ConsoleMonster.Styling.ThemeToken required
The value.

Returns

KeyValueList The same instance.

Examples

// C# initializer or property                                           // C# fluent
new global::ConsoleMonster.Widgets.KeyValueList { KeyRole = value };    Ui.KeyValue().KeyRole(value);
public static KeyValueList MaxKeyFraction(KeyValueList keyValueList, double value) #

Sets KeyValueList.MaxKeyFraction: Preferred key fraction when the natural label and value widths cannot both fit (default 0.4).

Parameters

keyValueList ConsoleMonster.Widgets.KeyValueList required
The instance.
value double required
The value.

Returns

KeyValueList The same instance.

Examples

// C# initializer or property                                                  // C# fluent
new global::ConsoleMonster.Widgets.KeyValueList { MaxKeyFraction = value };    Ui.KeyValue().MaxKeyFraction(value);
NumberColumn 2 overloads
public static KeyValueList NumberColumn(KeyValueList keyValueList, ColumnFormat value) #

Sets KeyValueList.NumberColumn: Layout of the leading number of each value (234 / 332, 8.4 rules/s, ~12s): when every value starts with a number, the numbers share a column, right-aligned by default, so they line up under each other. A list that mixes in text (a host name, an OS) keeps every value left-aligned as written, so "3 days" under a name is not pushed right. Set the alignment to HorizontalAlignment.Left to always print values as written.

Parameters

keyValueList ConsoleMonster.Widgets.KeyValueList required
The instance.
value ConsoleMonster.Layout.ColumnFormat required
The value.

Returns

KeyValueList The same instance.

Examples

// C# initializer or property                                                // C# fluent
new global::ConsoleMonster.Widgets.KeyValueList { NumberColumn = value };    Ui.KeyValue().NumberColumn(value);
public static KeyValueList NumberColumn(KeyValueList keyValueList, Action<ColumnFormat> configure) #

Configures KeyValueList.NumberColumn in place: Layout of the leading number of each value (234 / 332, 8.4 rules/s, ~12s): when every value starts with a number, the numbers share a column, right-aligned by default, so they line up under each other. A list that mixes in text (a host name, an OS) keeps every value left-aligned as written, so "3 days" under a name is not pushed right. Set the alignment to HorizontalAlignment.Left to always print values as written.

Parameters

keyValueList ConsoleMonster.Widgets.KeyValueList required
The instance.
configure System.Action<ConsoleMonster.Layout.ColumnFormat> required
Configures the value.

Returns

KeyValueList The same instance.
Presentation 2 overloads
public static KeyValueList Presentation(KeyValueList keyValueList, PresentationOptions value) #

Sets KeyValueList.Presentation: Culture, clock and time zone for values added with KeyValueList.Value.

Parameters

keyValueList ConsoleMonster.Widgets.KeyValueList required
The instance.
value ConsoleMonster.Presenters.PresentationOptions required
The value.

Returns

KeyValueList The same instance.

Examples

// C# initializer or property                                                // C# fluent
new global::ConsoleMonster.Widgets.KeyValueList { Presentation = value };    Ui.KeyValue().Presentation(value);
public static KeyValueList Presentation(KeyValueList keyValueList, Action<PresentationOptions> configure) #

Configures KeyValueList.Presentation in place (creating it when not set): Culture, clock and time zone for values added with KeyValueList.Value.

Parameters

keyValueList ConsoleMonster.Widgets.KeyValueList required
The instance.
configure System.Action<ConsoleMonster.Presenters.PresentationOptions> required
Configures the value.

Returns

KeyValueList The same instance.