Skip to content
ConsoleMonster
Class

RoleTable

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
sealed

A composition of RoleTable.Table with a dedicated marker column and whole-row roles.

Inheritance

  • object
  • RoleTable

Usage

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

Returned or exposed by 3

Accepted by parameters 2

Constructors

public RoleTable(IEnumerable<TableColumn> columns) #

Creates a table, prepending a marker column without changing the supplied column definitions.

Parameters

columns System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.TableColumn> required
The data columns; the first is the key unless another column explicitly is.

Methods

public RoleTable AddRow(TableRowRole? role, params TableCell[] cells) #

Adds data cells after the marker column, retaining their raw values and original instances.

Parameters

role ConsoleMonster.Widgets.TableRowRole? required
The row role, or null for an ordinary unmarked row.
cells ConsoleMonster.Widgets.TableCell[] required
The data cells, excluding the marker column.

Returns

RoleTable This widget.
public Size Measure(Constraints constraints, RenderContext context) #

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints required
The space offered.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Returns

Size The desired size, never larger than the constraints.
public void Render(Region region, RenderContext context) #

Renders into a region. The region may be smaller or larger than the measured size.

Parameters

region ConsoleMonster.Canvas.Region required
The target region.
context ConsoleMonster.Canvas.RenderContext required
Profile, theme and glyphs.

Properties

public Table Table { get; } #

The composed table, for ordinary border, header, card, grouping and summary options.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

Extension Methods

public static RoleTable Table(RoleTable roleTable, Action<Table> configure) #

Configures RoleTable.Table in place: The composed table, for ordinary border, header, card, grouping and summary options.

Parameters

roleTable ConsoleMonster.Widgets.RoleTable required
The instance.
configure System.Action<ConsoleMonster.Widgets.Table> required
Configures the value.

Returns

RoleTable The same instance.