API Reference
CellMap
One cell per item of a run, in item order, flowing to the width: each state has its own symbol (✓ ✗ ▴ – ○ in Full and Basic, + x ! - . in ASCII), so outcomes read without colour; running items spin; a legend counts each state. Generic: tests, hosts, files, any list of work. Live operations: set (Key = item index, State = status word), add (State, optional), count (Value = the number of items, new ones pending).
Inheritance
- LiveWidget
- CellMap
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.
Returned or exposed by 12
- Extension method CellMap.WithGap
- Extension method CellMap.WithMaxRows
- Extension method CellMap.WithShowLegend
- Extension method CellMap.WithSpinRunning
- Extension method CellMap.WithWindow
- Method CellMap.Resize
- Method CellMap.Set
- Method CellMapFluent.WithGap
- Method CellMapFluent.WithMaxRows
- Method CellMapFluent.WithShowLegend
- Method CellMapFluent.WithSpinRunning
- Method CellMapFluent.WithWindow
Accepted by parameters 10
- Extension method CellMap.WithGap
- Extension method CellMap.WithMaxRows
- Extension method CellMap.WithShowLegend
- Extension method CellMap.WithSpinRunning
- Extension method CellMap.WithWindow
- Method CellMapFluent.WithGap
- Method CellMapFluent.WithMaxRows
- Method CellMapFluent.WithShowLegend
- Method CellMapFluent.WithSpinRunning
- Method CellMapFluent.WithWindow
Constructors
public CellMap(String name = "cells") #Creates a cell map.
Parameters
- name System.String = "cells"
- The live name (default cells).
Methods
public Int32 Add(StatusKind state = Pending) #Int32Adds an item.
Parameters
- state ConsoleMonster.Styling.StatusKind = Pending
- Its state (default pending).
Returns
The new item's index.
public override Void Apply(LiveEvent liveEvent) #VoidApplies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public static String CountLabel(StatusKind state, Int32 count, RenderContext context) #StringA count with the word for its state in the current language: "12 passed", "3 failed", "45 queued".
Parameters
- state ConsoleMonster.Styling.StatusKind
- The state.
- count System.Int32
- The count.
- context ConsoleMonster.Canvas.RenderContext
- The render context (labels and culture).
Returns
The text.
public Int32 CountOf(StatusKind state) #Int32How many items are in a state.
Parameters
- state ConsoleMonster.Styling.StatusKind
- The state.
Returns
The count.
public StyledLine Legend(RenderContext context) #StyledLineThe legend: each state present with its symbol and count ("✓ 12 passed ✗ 3 failed ○ 45 queued").
Parameters
- context ConsoleMonster.Canvas.RenderContext
- The render context.
Returns
The legend line.
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 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 CellMap Resize(Int32 count) #CellMapSets the number of items: new ones are pending, extra ones are removed.
Parameters
- count System.Int32
- The count.
Returns
This instance.
public CellMap Set(Int32 index, StatusKind state) #CellMapSets an item's state, growing the map when the index is past the end.
Parameters
- index System.Int32
- The item index.
- state ConsoleMonster.Styling.StatusKind
- The state.
Returns
This instance.
Inherited Methods
public virtual String? Describe(LiveEvent liveEvent) #String?Parameters
- liveEvent LiveEvent
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public Boolean ShowLegend { get; set; } #Whether a legend line with each state's count follows the cells (default true).
public Int32 MaxRows { get; set; } #The most rows of cells (0 = all); a last line then counts the items not shown.
public CellWindow Window { get; set; } #Which rows show when there are more than CellMap.MaxRows (default CellWindow.Head).
public Boolean SpinRunning { get; set; } #Whether running cells spin (default true); false shows the still running symbol, when another part of the screen already spins.
public StatusKind this[Int32 index] { get; } #The state of an item.
Parameters
- index System.Int32
- The item index.
Inherited Properties
Fields
public const Int32 MaxItems #The most items a map holds (1,000,000): live events past it are ignored, so a mistyped index cannot exhaust memory.
1000000Extension Methods
public static CellMap WithGap(CellMap cellMap, Int32 value) #CellMapSets CellMap.Gap: The cells between symbols (default 1).
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static CellMap WithMaxRows(CellMap cellMap, Int32 value) #CellMapSets CellMap.MaxRows: The most rows of cells (0 = all); a last line then counts the items not shown.
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static CellMap WithShowLegend(CellMap cellMap, Boolean value = true) #CellMapSets CellMap.ShowLegend: Whether a legend line with each state's count follows the cells (default true).
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static CellMap WithSpinRunning(CellMap cellMap, Boolean value = true) #CellMapSets CellMap.SpinRunning: Whether running cells spin (default true); false shows the still running symbol, when another part of the screen already spins.
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static CellMap WithWindow(CellMap cellMap, CellWindow value) #CellMapSets CellMap.Window: Which rows show when there are more than CellMap.MaxRows (default CellWindow.Head).
Parameters
- cellMap ConsoleMonster.Widgets.CellMap
- The instance.
- value ConsoleMonster.Widgets.CellMap.CellWindow
- The value.
Returns
The same instance.