API Reference
LiveTable
A table whose rows change while a live session runs: rows have stable keys and are added, updated, removed or cleared through a LiveTableHandle (thread-safe, through the update queue). The LiveTable.Table defines the columns, presenters and options; its column widths only grow (Table.StableWidths), so rows never jitter while values change. Optionally only the most recent LiveTable.MaxRows rows are kept, and rows can be kept sorted by a column. Live operations (Key = row key): add and update (Payload = the values; both insert or replace), remove, clear. A recording replays the tab-separated text form of the values.
Inheritance
- LiveWidget
- LiveTable
Usage
Explore 16 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 8
- Extension method LiveTable.WithMaxRows
- Extension method LiveTable.WithSortColumn
- Extension method LiveTable.WithSortDescending
- Extension method LiveTable.WithTable
- Method LiveTableFluent.WithMaxRows
- Method LiveTableFluent.WithSortColumn
- Method LiveTableFluent.WithSortDescending
- Method LiveTableFluent.WithTable
Accepted by parameters 8
- Extension method LiveTable.WithMaxRows
- Extension method LiveTable.WithSortColumn
- Extension method LiveTable.WithSortDescending
- Extension method LiveTable.WithTable
- Method LiveTableFluent.WithMaxRows
- Method LiveTableFluent.WithSortColumn
- Method LiveTableFluent.WithSortDescending
- Method LiveTableFluent.WithTable
Constructors
public LiveTable(Table table, String name = "table") #Creates a live table.
Parameters
- table ConsoleMonster.Widgets.Table
- The table that defines the columns and options (its own rows are replaced).
- name System.String = "table"
- The live name (default table).
Methods
public override Void Apply(LiveEvent liveEvent) #VoidApplies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public override String? Describe(LiveEvent liveEvent) #String?Returns a line describing the event for line-based outputs (Stream/Plain), or null when the event is not worth a line (for example a single counter increment). Called after ILiveTarget.Apply.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event that was applied.
Returns
A plain line or null.
public LiveTableHandle Handle(ILiveDispatcher dispatcher) #LiveTableHandleA handle that changes rows through a dispatcher (a live session).
Parameters
- dispatcher ConsoleMonster.Live.ILiveDispatcher
- The dispatcher.
Returns
The handle.
public override Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public Boolean Remove(String key) #BooleanRemoves a row directly (not thread-safe; use a handle while a session runs).
Parameters
- key System.String
- The row key.
Returns
Whether the row existed.
public override Void Render(Region region, RenderContext context) #VoidRenders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public Void Set(String key, params Object?[] values) #VoidAdds or replaces a row directly (not thread-safe; use a handle while a session runs).
Parameters
- key System.String
- The row key.
- values System.Object?[]
- The values, one per column.
public static String TextOf(Object?[] values) #StringThe text form of row values that recordings keep (tab-separated plain text).
Parameters
- values System.Object?[]
- The values.
Returns
The text.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public Table Table { get; } #The table that defines the columns, presenters and options.
public Int32 MaxRows { get; set; } #Keeps only the most recently added rows (0, the default, keeps them all): a bounded "recent N" window.
public Int32? SortColumn { get; set; } #The column index to keep rows sorted by, or null (default) for insertion order.
public Boolean SortDescending { get; set; } #Whether LiveTable.SortColumn sorts from the largest value down.
Inherited Properties
Extension Methods
public static LiveTable WithMaxRows(LiveTable liveTable, Int32 value) #LiveTableSets LiveTable.MaxRows: Keeps only the most recently added rows (0, the default, keeps them all): a bounded "recent N" window.
Parameters
- liveTable ConsoleMonster.Widgets.LiveTable
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static LiveTable WithSortColumn(LiveTable liveTable, Int32? value) #LiveTableSets LiveTable.SortColumn: The column index to keep rows sorted by, or null (default) for insertion order.
Parameters
- liveTable ConsoleMonster.Widgets.LiveTable
- The instance.
- value System.Int32?
- The value.
Returns
The same instance.
public static LiveTable WithSortDescending(LiveTable liveTable, Boolean value = true) #LiveTableSets LiveTable.SortDescending: Whether LiveTable.SortColumn sorts from the largest value down.
Parameters
- liveTable ConsoleMonster.Widgets.LiveTable
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static LiveTable WithTable(LiveTable liveTable, Action<Table> configure) #LiveTableConfigures LiveTable.Table in place: The table that defines the columns, presenters and options.
Parameters
- liveTable ConsoleMonster.Widgets.LiveTable
- The instance.
- configure System.Action<ConsoleMonster.Widgets.Table>
- Configures the value.
Returns
The same instance.