Skip to content
ConsoleMonster
Class

Dashboard

ConsoleMonster.Widgets

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 55 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 28

Constructors

public Dashboard(string title = "", IWidget? content = null, string widgetId = "dashboard") #

Creates a dashboard.

Parameters

title string = "" optional
The title (markup).
content ConsoleMonster.Layout.IWidget? = null optional
The body.
widgetId string = "dashboard" optional
The live name (default dashboard).

Methods

public override void Apply(LiveEvent liveEvent) #

Applies an event to the widget's state.

Parameters

liveEvent ConsoleMonster.Live.LiveEvent required
The event.
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 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 void RenderCompact(Region region, RenderContext context) #

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

Parameters

region ConsoleMonster.Canvas.Region required
The region (possibly tiny or empty).
context ConsoleMonster.Canvas.RenderContext required
The render context.
public bool TryGetTaskbarProgress(out TaskbarState state, out double fraction) #

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

Parameters

state ConsoleMonster.Output.TaskbarState required
The state.
fraction double required
Always NaN (the body's widgets report the percentage).

Returns

bool 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; } #
Fluent("CompactSummaryBy")

The progress text for the compact status line (for example 218/332 · ✗12 ▲25), or null to use Dashboard.Detail. 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? Detail { get; set; } #

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

public StatusKind? Status { get; set; } #

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

public IList<KeyHint> FooterHints { get; } #

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

public IList<FooterSegment> FooterSegments { get; } #

Links and notes on the right of the footer (a report, the docs), as links where the terminal supports them.

public bool ShowElapsed { get; set; } #

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

public IWidget Content { get; set; } #

The body.

public IReadOnlyList<IWidget> Children { get; } #

The child widgets in layout order.

Extension Methods

public static Dashboard CompactSummaryBy(Dashboard dashboard, Func<string>? value) #

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

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
value System.Func<string>? required
The callback.

Returns

Dashboard The same instance.

Examples

// C# initializer or property                                               // C# fluent
new global::ConsoleMonster.Widgets.Dashboard { CompactSummary = value };    Ui.Dashboard().CompactSummaryBy(value);
Content 2 overloads
public static Dashboard Content(Dashboard dashboard, IWidget content) #

Configures this container's content before session ownership.

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
content ConsoleMonster.Layout.IWidget required
The widget or nested content builder.

Returns

Dashboard The same instance.
public static Dashboard Content(Dashboard dashboard, Action<ContentBuilder> content) #

Configures this container's content before session ownership.

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
content System.Action<ConsoleMonster.Layout.ContentBuilder> required
The widget or nested content builder.

Returns

Dashboard The same instance.
public static Dashboard Detail(Dashboard dashboard, string? value) #

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

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
value string? required
The value.

Returns

Dashboard The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ConsoleMonster.Widgets.Dashboard { Detail = value };    Ui.Dashboard().Detail(value);
public static Dashboard FooterHint(Dashboard dashboard, KeyHint item) #

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 required
The instance.
item ConsoleMonster.Widgets.KeyHint required
The item.

Returns

Dashboard The same instance.
public static Dashboard FooterHints(Dashboard dashboard, IEnumerable<KeyHint> items) #

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 required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.KeyHint> required
The items, in order.

Returns

Dashboard The same instance.
public static Dashboard FooterSegment(Dashboard dashboard, FooterSegment item) #

Adds an item to Dashboard.FooterSegments: Links and notes on the right of the footer (a report, the docs), as links where the terminal supports them.

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
item ConsoleMonster.Widgets.FooterSegment required
The item.

Returns

Dashboard The same instance.
public static Dashboard FooterSegments(Dashboard dashboard, IEnumerable<FooterSegment> items) #

Adds items to Dashboard.FooterSegments: Links and notes on the right of the footer (a report, the docs), as links where the terminal supports them.

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
items System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.FooterSegment> required
The items, in order.

Returns

Dashboard The same instance.
public static Dashboard MinimumSize(Dashboard dashboard, Size value) #

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 required
The instance.
value ConsoleMonster.Layout.Size required
The value.

Returns

Dashboard The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ConsoleMonster.Widgets.Dashboard { MinimumSize = value };    Ui.Dashboard().MinimumSize(value);
public static Dashboard ShowElapsed(Dashboard dashboard, bool value = true) #

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

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
value bool = true optional
The value; true when omitted.

Returns

Dashboard The same instance.

Examples

// C# initializer or property                                            // C# fluent
new global::ConsoleMonster.Widgets.Dashboard { ShowElapsed = value };    Ui.Dashboard().ShowElapsed(value);
public static Dashboard Status(Dashboard dashboard, StatusKind? value) #

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

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
value ConsoleMonster.Styling.StatusKind? required
The value.

Returns

Dashboard The same instance.

Examples

// C# initializer or property                                       // C# fluent
new global::ConsoleMonster.Widgets.Dashboard { Status = value };    Ui.Dashboard().Status(value);
public static Dashboard Subtitle(Dashboard dashboard, string? value) #

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

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
value string? required
The value.

Returns

Dashboard The same instance.

Examples

// C# initializer or property                                         // C# fluent
new global::ConsoleMonster.Widgets.Dashboard { Subtitle = value };    Ui.Dashboard().Subtitle(value);
public static Dashboard Title(Dashboard dashboard, string value) #

Sets Dashboard.Title: The title (markup).

Parameters

dashboard ConsoleMonster.Widgets.Dashboard required
The instance.
value string required
The value.

Returns

Dashboard The same instance.

Examples

// C# initializer or property                                      // C# fluent
new global::ConsoleMonster.Widgets.Dashboard { Title = value };    Ui.Dashboard().Title(value);