Skip to content
ConsoleMonster

API Reference

Class

Dashboard

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Modifiers sealed

A full-screen shell for live sessions: a header bar (title, subtitle, status and elapsed clock), the body and a footer bar (hints such as "Ctrl+C to stop"). In print-once output it renders the same parts top to bottom. Live operations: title (Text), subtitle (Text), status (Text, State), footer (Text).

Inheritance

Usage

Explore 42 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 20

Constructors

public Dashboard(String title, IWidget body, String name = "dashboard") #

Creates a dashboard.

Parameters

title System.String requiredposition: 0
The title (markup).
body ConsoleMonster.Layout.IWidget requiredposition: 1
The body.
name System.String = "dashboard" optionalposition: 2
The live name (default dashboard).

Methods

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 override String? Describe(LiveEvent liveEvent) #
Returns: 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 requiredposition: 0
The event that was applied.

Returns

A plain line or null.

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 Void RenderCompact(Region region, RenderContext context) #
Returns: Void

Renders the compact form into a region smaller than ICompactWidget.MinimumSize.

Parameters

region ConsoleMonster.Canvas.Region requiredposition: 0
The region (possibly tiny or empty).
context ConsoleMonster.Canvas.RenderContext requiredposition: 1
The render context.
public Boolean TryGetTaskbarProgress(out TaskbarState state, out Double fraction) #
Returns: Boolean

The run state for the terminal's indicator: red after a failure status, yellow after a warning status.

Parameters

state ConsoleMonster.Output.TaskbarState requiredposition: 0
The state.
fraction System.Double requiredposition: 1
Always NaN (the body's widgets report the percentage).

Returns

Whether the status is a failure or a warning.

Properties

public Size MinimumSize { get; set; } #

The smallest window the full layout needs (default 60 × 14). Below it a live session renders the compact form: a one-line status and the highest-priority Prioritized widgets that fit.

public Func<String>? CompactSummary { get; set; } #

The progress text for the compact status line (for example 218/332 · ✗12 ▲25), or null to use Dashboard.Status. Called on the render thread.

public String Title { get; set; } #

The title (markup).

public String? Subtitle { get; set; } #

The subtitle (markup), shown after the title.

public String? Status { get; set; } #

A status shown on the right of the header (markup).

public StatusKind? StatusLevel { get; set; } #

The status kind, shown as a marker before Dashboard.Status.

public IList<KeyHint> FooterHints { get; } #

The key hints in the footer when Dashboard.Footer is not set (default: ctrl+c stop).

public Boolean ShowClock { get; set; } #

Whether the elapsed clock is shown in the header (default true).

public IWidget Body { get; } #

The body.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

Extension Methods

public static Dashboard AddFooterHint(Dashboard dashboard, KeyHint item) #
Returns: Dashboard

Adds an item to Dashboard.FooterHints: The key hints in the footer when Dashboard.Footer is not set (default: ctrl+c stop).

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
item ConsoleMonster.Widgets.KeyHint requiredposition: 1
The item.

Returns

The same instance.

AddFooterHints 2 overloads
public static Dashboard AddFooterHints(Dashboard dashboard, params KeyHint[] items) #
Returns: Dashboard

Adds items to Dashboard.FooterHints: The key hints in the footer when Dashboard.Footer is not set (default: ctrl+c stop).

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
items ConsoleMonster.Widgets.KeyHint[] requiredposition: 1
The items, in order.

Returns

The same instance.

public static Dashboard AddFooterHints(Dashboard dashboard, IEnumerable<KeyHint> items) #
Returns: Dashboard

Adds items to Dashboard.FooterHints: The key hints in the footer when Dashboard.Footer is not set (default: ctrl+c stop).

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.KeyHint> requiredposition: 1
The items, in order.

Returns

The same instance.

public static Dashboard WithCompactSummary(Dashboard dashboard, Func<String>? value) #
Returns: Dashboard

Sets Dashboard.CompactSummary: The progress text for the compact status line (for example 218/332 · ✗12 ▲25), or null to use Dashboard.Status. Called on the render thread.

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
value System.Func<System.String>? requiredposition: 1
The value.

Returns

The same instance.

public static Dashboard WithFooter(Dashboard dashboard, String? value) #
Returns: Dashboard

Sets Dashboard.Footer: The footer text (markup), or null for no footer.

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static Dashboard WithMinimumSize(Dashboard dashboard, Size value) #
Returns: Dashboard

Sets Dashboard.MinimumSize: The smallest window the full layout needs (default 60 × 14). Below it a live session renders the compact form: a one-line status and the highest-priority Prioritized widgets that fit.

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
value ConsoleMonster.Layout.Size requiredposition: 1
The value.

Returns

The same instance.

public static Dashboard WithShowClock(Dashboard dashboard, Boolean value = true) #
Returns: Dashboard

Sets Dashboard.ShowClock: Whether the elapsed clock is shown in the header (default true).

Parameters

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

Returns

The same instance.

public static Dashboard WithStatus(Dashboard dashboard, String? value) #
Returns: Dashboard

Sets Dashboard.Status: A status shown on the right of the header (markup).

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static Dashboard WithStatusLevel(Dashboard dashboard, StatusKind? value) #
Returns: Dashboard

Sets Dashboard.StatusLevel: The status kind, shown as a marker before Dashboard.Status.

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
value ConsoleMonster.Styling.StatusKind? requiredposition: 1
The value.

Returns

The same instance.

public static Dashboard WithSubtitle(Dashboard dashboard, String? value) #
Returns: Dashboard

Sets Dashboard.Subtitle: The subtitle (markup), shown after the title.

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
value System.String? requiredposition: 1
The value.

Returns

The same instance.

public static Dashboard WithTitle(Dashboard dashboard, String value) #
Returns: Dashboard

Sets Dashboard.Title: The title (markup).

Parameters

dashboard ConsoleMonster.Widgets.Dashboard requiredposition: 0
The instance.
value System.String requiredposition: 1
The value.

Returns

The same instance.