Skip to content
ConsoleMonster

API Reference

Class

CellMap

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Implements
Modifiers sealed
Attributes
DefaultMember("Item")

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

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 10

Constructors

public CellMap(String name = "cells") #

Creates a cell map.

Parameters

name System.String = "cells" optionalposition: 0
The live name (default cells).

Methods

public Int32 Add(StatusKind state = Pending) #
Returns: Int32

Adds an item.

Parameters

state ConsoleMonster.Styling.StatusKind = Pending optionalposition: 0
Its state (default pending).

Returns

The new item's index.

public override Void Apply(LiveEvent liveEvent) #
Returns: Void

Applies an event to the widget's state.

Parameters

liveEvent ConsoleMonster.Live.LiveEvent requiredposition: 0
The event.
public static String CountLabel(StatusKind state, Int32 count, RenderContext context) #
Returns: String

A count with the word for its state in the current language: "12 passed", "3 failed", "45 queued".

Parameters

state ConsoleMonster.Styling.StatusKind requiredposition: 0
The state.
count System.Int32 requiredposition: 1
The count.
context ConsoleMonster.Canvas.RenderContext requiredposition: 2
The render context (labels and culture).

Returns

The text.

public Int32 CountOf(StatusKind state) #
Returns: Int32

How many items are in a state.

Parameters

state ConsoleMonster.Styling.StatusKind requiredposition: 0
The state.

Returns

The count.

public StyledLine Legend(RenderContext context) #
Returns: StyledLine

The legend: each state present with its symbol and count ("✓ 12 passed ✗ 3 failed ○ 45 queued").

Parameters

context ConsoleMonster.Canvas.RenderContext requiredposition: 0
The render context.

Returns

The legend line.

public override Size Measure(Constraints constraints, RenderContext context) #
Returns: Size

Returns the size the widget wants within the constraints.

Parameters

constraints ConsoleMonster.Layout.Constraints requiredposition: 0
The space offered.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.

Returns

The desired size, never larger than the constraints.

public override Void Render(Region region, RenderContext context) #
Returns: Void

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

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The target region.
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
Profile, theme and glyphs.
public CellMap Resize(Int32 count) #
Returns: CellMap

Sets the number of items: new ones are pending, extra ones are removed.

Parameters

count System.Int32 requiredposition: 0
The count.

Returns

This instance.

public CellMap Set(Int32 index, StatusKind state) #
Returns: CellMap

Sets an item's state, growing the map when the index is past the end.

Parameters

index System.Int32 requiredposition: 0
The item index.
state ConsoleMonster.Styling.StatusKind requiredposition: 1
The state.

Returns

This instance.

Properties

public Int32 Count { get; } #

The number of items.

public Int32 Gap { get; set; } #

The cells between symbols (default 1).

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 requiredposition: 0
The item index.

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.

Value: 1000000

Extension Methods

public static CellMap WithGap(CellMap cellMap, Int32 value) #
Returns: CellMap

Sets CellMap.Gap: The cells between symbols (default 1).

Parameters

cellMap ConsoleMonster.Widgets.CellMap requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static CellMap WithMaxRows(CellMap cellMap, Int32 value) #
Returns: CellMap

Sets CellMap.MaxRows: The most rows of cells (0 = all); a last line then counts the items not shown.

Parameters

cellMap ConsoleMonster.Widgets.CellMap requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static CellMap WithShowLegend(CellMap cellMap, Boolean value = true) #
Returns: CellMap

Sets CellMap.ShowLegend: Whether a legend line with each state's count follows the cells (default true).

Parameters

cellMap ConsoleMonster.Widgets.CellMap requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static CellMap WithSpinRunning(CellMap cellMap, Boolean value = true) #
Returns: CellMap

Sets 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 requiredposition: 0
The instance.
value System.Boolean = true optionalposition: 1
The value (default true).

Returns

The same instance.

public static CellMap WithWindow(CellMap cellMap, CellWindow value) #
Returns: CellMap

Sets CellMap.Window: Which rows show when there are more than CellMap.MaxRows (default CellWindow.Head).

Parameters

cellMap ConsoleMonster.Widgets.CellMap requiredposition: 0
The instance.
value ConsoleMonster.Widgets.CellMap.CellWindow requiredposition: 1
The value.

Returns

The same instance.