Skip to content
ConsoleMonster

API Reference

Class

Table`1

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Base Table
Implements
Modifiers sealed

A Table whose rows are read from typed items (Table.For): each column has a value selector, and every table option and fluent method applies as usual. Without columns, every public property of T is a column, read without reflection over anything else. The items are read when the table is first laid out and after Table.Refresh. Table.For(servers) .WithTitle("Servers") .Column(s => s.Name, c => c.WithIsKey()) .Column(s => s.Ram, c => c.WithPresenter(CellPresenters.Bytes)) .WithTotals();

Inheritance

Usage

Explore 22 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.

Accepted by parameters 3

Type Parameters

T
The item type.

Methods

Column 2 overloads
public Table<T?> Column(Func<T?, Object?> value, Action<TableColumn>? configure = null, String? expression = null) #
Returns: Table<T?>

Adds a column read from each item. The header comes from the expression (s => s.Name is "Name", s => s.Address.City is "City"); set another with c => c.WithHeader("...").

Parameters

value System.Func<T?, System.Object?> requiredposition: 0
Reads the value from an item.
configure System.Action<ConsoleMonster.Widgets.TableColumn>? = null optionalposition: 1
Configures the column (priority, presenter, overflow...), or null.
expression System.String? = null optionalposition: 2
Filled in by the compiler from value; leave it out.

Returns

This table.

public Table<T?> Column(String header, Func<T?, Object?> value, Action<TableColumn>? configure = null) #
Returns: Table<T?>

Adds a column read from each item, with a header.

Parameters

header System.String requiredposition: 0
The header (markup).
value System.Func<T?, System.Object?> requiredposition: 1
Reads the value from an item.
configure System.Action<ConsoleMonster.Widgets.TableColumn>? = null optionalposition: 2
Configures the column, or null.

Returns

This table.

public Table<T?> Refresh() #
Returns: Table<T?>

Reads the items again at the next layout (after the collection changed).

Returns

This table.

Properties

public IEnumerable<T?> Items { get; } #

The items the rows are read from.