Skip to content
ConsoleMonster
Class

MenuRunResult

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Modifiers
sealed

The outcome of a run, shown by the menu afterwards: a status, a summary, key figures, details and next actions.

Inheritance

  • object
  • MenuRunResult

Usage

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

Accepted by parameters 2

Constructors

public MenuRunResult(string title, StatusKind status = Pass) #

Creates a result.

Parameters

title string required
The title ("Checks finished").
status ConsoleMonster.Styling.StatusKind = Pass optional
The status.

Methods

Figure 2 overloads
public MenuRunResult Figure(string label, string value) #

Adds a key figure.

Parameters

label string required
The label.
value string required
The value.

Returns

MenuRunResult The result.
public MenuRunResult Figure(string label, string value, StatusKind status) #

Adds a key figure whose number carries a status colour (use it only for figures that need attention).

Parameters

label string required
The label.
value string required
The value.
status ConsoleMonster.Styling.StatusKind required
The status.

Returns

MenuRunResult The result.
public MenuRunResult Next(string title, Action<MenuContext> action) #

Adds a next action.

Parameters

title string required
The title.
action System.Action<ConsoleMonster.Interactive.MenuContext> required
The action.

Returns

MenuRunResult The result.

Properties

public string Title { get; set; } #

The title.

public StatusKind Status { get; set; } #

The status.

public string? Summary { get; set; } #

A sentence under the title.

public IList<KeyValuePair<string, string>> Figures { get; } #

Key figures shown as label/value pairs ("Passed" = "41").

public IDictionary<string, StatusKind> FigureStatus { get; } #

The status of each figure that has one (its number is coloured), by label.

public IWidget? Details { get; set; } #

Detail content under the figures (a table, a list).

public IList<MenuItem> NextActions { get; } #

Actions offered next ("Open report", "Run failed again", "Export").

public TimeSpan Elapsed { get; set; } #

How long the run took; left at zero, a run started with MenuContext.Run fills it in from the session clock (LiveSessionOptions.Clock), so a SimulatedClock gives its time.

public Exception? Error { get; set; } #

The exception that ended the run, if any.