Skip to content
ConsoleMonster
Class

StatusList

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Implements
IWidget ILiveTarget ILineFlow
Modifiers
sealed

A checklist: a status marker, a label and a right-aligned muted detail per row. Running rows show a spinner. Only the marker carries colour (one signal per row). Live operations: set (Key, State, Text = label, optional Total ignored) and detail (Key, Text).

Inheritance

Usage

Explore 10 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 6

Accepted by parameters 4

Constructors

public StatusList(string widgetId = "status") #

Creates a status list.

Parameters

widgetId string = "status" optional
The live name (default status).

Methods

Add 2 overloads
public StatusList Add(string label, StatusKind status, string? detail = null) #

Adds a row (alias of StatusList.Set).

Parameters

label string required
Label (markup); also the key.
status ConsoleMonster.Styling.StatusKind required
Status.
detail string? = null optional
Detail.

Returns

StatusList This instance.
public StatusList Add(RichText label, StatusKind status, string? detail = null) #

Adds or updates an item with a multicolour label (its plain text is the key).

Parameters

label ConsoleMonster.Text.RichText required
The label.
status ConsoleMonster.Styling.StatusKind required
The status.
detail string? = null optional
An optional muted detail.

Returns

StatusList This instance.
public override void Apply(LiveEvent liveEvent) #

Applies an event to the widget's state.

Parameters

liveEvent ConsoleMonster.Live.LiveEvent required
The event.
public StatusList Child(string parentKey, string label, StatusKind status = None, string? detail = null) #

Adds a row nested under an existing row, indented under its label.

Parameters

parentKey string required
The key of the row it belongs to.
label string required
Label (markup).
status ConsoleMonster.Styling.StatusKind = None optional
Status (default StatusKind.None: a plain detail row).
detail string? = null optional
Detail, or null.

Returns

StatusList This instance.
public override string? Describe(LiveEvent liveEvent) #

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 required
The event that was applied.

Returns

string? A plain line or null.
public StatusListHandle Handle(ILiveDispatcher dispatcher) #

Returns a handle that updates this list through a dispatcher.

Parameters

dispatcher ConsoleMonster.Live.ILiveDispatcher required
The dispatcher.

Returns

StatusListHandle The handle.
public override 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 override 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.
public StatusList Set(string key, string? label, StatusKind status, string? detail = null) #

Adds or updates a row.

Parameters

key string required
Unique key.
label string? required
Label (markup); null keeps the existing label or uses the key.
status ConsoleMonster.Styling.StatusKind required
Status.
detail string? = null optional
Detail; null keeps the existing one.

Returns

StatusList This instance.

Properties

public IReadOnlyList<StatusItem> Items { get; } #

The rows.

public ColumnFormat DetailColumn { get; set; } #

Layout of the detail column on the right (default right-aligned). All rows share its width, which never shrinks during a session, so labels keep their room as details change.

Extension Methods

DetailColumn 2 overloads
public static StatusList DetailColumn(StatusList statusList, ColumnFormat value) #

Sets StatusList.DetailColumn: Layout of the detail column on the right (default right-aligned). All rows share its width, which never shrinks during a session, so labels keep their room as details change.

Parameters

statusList ConsoleMonster.Widgets.StatusList required
The instance.
value ConsoleMonster.Layout.ColumnFormat required
The value.

Returns

StatusList The same instance.

Examples

// C# initializer or property                                              // C# fluent
new global::ConsoleMonster.Widgets.StatusList { DetailColumn = value };    Ui.StatusList().DetailColumn(value);
public static StatusList DetailColumn(StatusList statusList, Action<ColumnFormat> configure) #

Configures StatusList.DetailColumn in place: Layout of the detail column on the right (default right-aligned). All rows share its width, which never shrinks during a session, so labels keep their room as details change.

Parameters

statusList ConsoleMonster.Widgets.StatusList required
The instance.
configure System.Action<ConsoleMonster.Layout.ColumnFormat> required
Configures the value.

Returns

StatusList The same instance.