Skip to content
ConsoleMonster

API Reference

Class

TableFluent

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

The fluent methods of Table, generated from its public properties: With... sets a property and Add... adds to a collection, both returning the same instance.

Inheritance

  • Object
  • TableFluent

Methods

public static TSelf AddColumn<TSelf>(TSelf table, String header, Action<TableColumn> configure) #
Returns: TSelf

Adds a column with a header and an optional configuration.

Type Parameters

TSelf
The table type.

Parameters

table TSelf requiredposition: 0
The table.
header System.String requiredposition: 1
The header (markup).
configure System.Action<ConsoleMonster.Widgets.TableColumn> requiredposition: 2
Configures the column (priority, presenter, overflow...), or null.

Returns

The same table.

AddRowTitles``1 2 overloads
public static TSelf AddRowTitles<TSelf>(TSelf table, params String?[] items) #
Returns: TSelf

Adds items to Table.RowTitles: Titles for the rows in record and card views, by data row index (a null or empty entry uses the key column), so a caller can title a record "pwsh (90836)" while the key column stays the name. Null for none.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
items System.String?[] requiredposition: 1
The items, in order.

Returns

The same instance.

public static TSelf AddRowTitles<TSelf>(TSelf table, IEnumerable<String?> items) #
Returns: TSelf

Adds items to Table.RowTitles: Titles for the rows in record and card views, by data row index (a null or empty entry uses the key column), so a caller can title a record "pwsh (90836)" while the key column stays the name. Null for none.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
items System.Collections.Generic.IEnumerable<System.String?> requiredposition: 1
The items, in order.

Returns

The same instance.

public static TSelf AddRowTitle<TSelf>(TSelf table, String? item) #
Returns: TSelf

Adds an item to Table.RowTitles: Titles for the rows in record and card views, by data row index (a null or empty entry uses the key column), so a caller can title a record "pwsh (90836)" while the key column stays the name. Null for none.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
item System.String? requiredposition: 1
The item.

Returns

The same instance.

public static TSelf WithAlwaysCards<TSelf>(TSelf table, Boolean value = true) #
Returns: TSelf

Sets Table.AlwaysCards: Shows the rows as record cards at any width (the Cards view of Show-Console).

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TSelf WithAutoTotals<TSelf>(TSelf table, Boolean value = true) #
Returns: TSelf

Sets Table.AutoTotals: With Table.ShowTotals, also sums every column whose values are all numbers (not the key column and not identifier columns such as Id or Port) when it has no TableColumn.Aggregate of its own.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TSelf WithBorder<TSelf>(TSelf table, TableBorder value) #
Returns: TSelf

Sets Table.Border: The border style (default rounded).

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value ConsoleMonster.Widgets.TableBorder requiredposition: 1
The value.

Returns

The same instance.

public static TSelf WithCaption<TSelf>(TSelf table, String? value) #
Returns: TSelf

Sets Table.Caption: A caption shown below the table (markup, muted).

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static TSelf WithCardsBelow<TSelf>(TSelf table, Int32 value) #
Returns: TSelf

Sets Table.CardsBelow: Below this many cells of width the rows render as record cards (key column as the card title); 0 disables cards. Default 60. Cards are used only when the grid cannot fit its minimum widths; they also take over when hiding columns would leave only the key column.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static TSelf WithExpand<TSelf>(TSelf table, Boolean value = true) #
Returns: TSelf

Sets Table.Expand: Whether the table fills the available width (spare width goes to the flexible column).

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TSelf WithHeaderSeparator<TSelf>(TSelf table, Boolean value = true) #
Returns: TSelf

Sets Table.HeaderSeparator: Whether a separator row is drawn under the header (default true). When false the header is underlined instead, so data starts on the row directly below it.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TSelf WithMaxRows<TSelf>(TSelf table, Int32 value) #
Returns: TSelf

Sets Table.MaxRows: Shows only the first N rows (0 = all) followed by Showing N of M; totals still cover every row.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

WithPresentation``1 2 overloads
public static TSelf WithPresentation<TSelf>(TSelf table, PresentationOptions value) #
Returns: TSelf

Sets Table.Presentation: Culture, clock and time zone for raw values.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value ConsoleMonster.Presenters.PresentationOptions requiredposition: 1
The value.

Returns

The same instance.

public static TSelf WithPresentation<TSelf>(TSelf table, Action<PresentationOptions> configure) #
Returns: TSelf

Configures Table.Presentation in place (creating it when not set): Culture, clock and time zone for raw values.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
configure System.Action<ConsoleMonster.Presenters.PresentationOptions> requiredposition: 1
Configures the value.

Returns

The same instance.

public static TSelf WithRecordViewRows<TSelf>(TSelf table, Int32 value) #
Returns: TSelf

Sets Table.RecordViewRows: A table with at most this many rows renders as a record view (default 1; 0 disables).

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static TSelf WithRowTitles<TSelf>(TSelf table, IList<String?>? value) #
Returns: TSelf

Sets Table.RowTitles: Titles for the rows in record and card views, by data row index (a null or empty entry uses the key column), so a caller can title a record "pwsh (90836)" while the key column stays the name. Null for none.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Collections.Generic.IList<System.String?>? requiredposition: 1
The value.

Returns

The same instance.

public static TSelf WithShowHeader<TSelf>(TSelf table, Boolean value = true) #
Returns: TSelf

Sets Table.ShowHeader: Whether the header row is shown (default true).

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TSelf WithShowHiddenColumns<TSelf>(TSelf table, Boolean value = true) #
Returns: TSelf

Sets Table.ShowHiddenColumns: Whether a footer names the columns hidden for lack of width (default true).

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TSelf WithShowSubtotals<TSelf>(TSelf table, Boolean value = true) #
Returns: TSelf

Sets Table.ShowSubtotals: Whether each group ends with a subtotal row for columns that have an TableColumn.Aggregate.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TSelf WithShowTotals<TSelf>(TSelf table, Boolean value = true) #
Returns: TSelf

Sets Table.ShowTotals: Whether a totals row summarises all rows (columns with an TableColumn.Aggregate), unless a footer is set.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TSelf WithStableWidths<TSelf>(TSelf table, Boolean value = true) #
Returns: TSelf

Sets Table.StableWidths: Whether column widths never shrink while the same table is re-rendered (live tables; default true), so columns do not jump as values change. Widths still fit the available space.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static TSelf WithTitle<TSelf>(TSelf table, String? value) #
Returns: TSelf

Sets Table.Title: A title shown above the table (markup).

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static TSelf WithTotalLabel<TSelf>(TSelf table, String? value) #
Returns: TSelf

Sets Table.TotalLabel: The label of the totals row, or null (default) for the built-in word (Total in English).

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static TSelf WithTotalRowCount<TSelf>(TSelf table, Int32? value) #
Returns: TSelf

Sets Table.TotalRowCount: The total number of records when the caller added only some of them (for example the first 50 of 1,234), so the footer can say Showing 50 of 1,234; null when every record was added.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Int32? requiredposition: 1
The value.

Returns

The same instance.

public static TSelf WithTotals<TSelf>(TSelf table, String? label = null) #
Returns: TSelf

Adds a totals row that sums every numeric column (Table.ShowTotals with Table.AutoTotals); columns with their own TableColumn.Aggregate keep it.

Type Parameters

TSelf
The table type.

Parameters

table TSelf requiredposition: 0
The table.
label System.String? = null optionalposition: 1
The label of the totals row, or null for the built-in word.

Returns

The same table.

public static TSelf WithWrapLines<TSelf>(TSelf table, Int32 value) #
Returns: TSelf

Sets Table.WrapLines: The most lines a wrapped value uses when its column sets no TableColumn.MaxLines (default 3; 0 = no limit): a long description stays a few lines with an ellipsis instead of taking the screen.

Type Parameters

TSelf

Parameters

table TSelf requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.