Skip to content
ConsoleMonster

API Reference

Class

ActivityList

Namespace ConsoleMonster.Widgets
Assembly ConsoleMonster
Modifiers sealed

Nested activities with progress, the way Write-Progress describes work: each activity has an id, an optional parent, a status, a percentage (or none) and an estimate of the time left. Children are indented under their parent; completed activities disappear. Empty, it takes no space, so it can sit in any layout and appear only while something reports progress. Events: update with key "id" or "id/parentId", text = activity, state = status, value = percent (negative for unknown) and total = seconds remaining (negative for unknown); complete with the key.

Inheritance

Usage

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

Constructors

public ActivityList(String name = "$progress") #

Creates an activity list.

Parameters

name System.String = "$progress" optionalposition: 0
The target name (default ActivityList.ProgressTarget).

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 Boolean TryGetTaskbarProgress(out TaskbarState state, out Double fraction) #
Returns: Boolean

The widget's contribution, if any.

Parameters

state ConsoleMonster.Output.TaskbarState requiredposition: 0
The state (Normal, Indeterminate, Error or Paused).
fraction System.Double requiredposition: 1
The fraction done (0 to 1), or NaN when unknown.

Returns

False when the widget has nothing to report.

Properties

public Int32 MaxVisible { get; set; } #

The most activities shown (default 8); more are summarised in one line.

public Int32 Count { get; } #

The number of activities in progress.

public Boolean ShowElapsed { get; set; } #

Whether each row ends with the time since the activity started, right-aligned (default true).

public Boolean ShowIds { get; set; } #

Whether each row starts with the activity's id (#3), for parallel work (default false).

Fields

public const String ProgressTarget #

The target name the PowerShell progress bridge posts to.

Value: $progress

Extension Methods

public static ActivityList WithMaxVisible(ActivityList activityList, Int32 value) #
Returns: ActivityList

Sets ActivityList.MaxVisible: The most activities shown (default 8); more are summarised in one line.

Parameters

activityList ConsoleMonster.Widgets.ActivityList requiredposition: 0
The instance.
value System.Int32 requiredposition: 1
The value.

Returns

The same instance.

public static ActivityList WithShowElapsed(ActivityList activityList, Boolean value = true) #
Returns: ActivityList

Sets ActivityList.ShowElapsed: Whether each row ends with the time since the activity started, right-aligned (default true).

Parameters

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

Returns

The same instance.

public static ActivityList WithShowIds(ActivityList activityList, Boolean value = true) #
Returns: ActivityList

Sets ActivityList.ShowIds: Whether each row starts with the activity's id (#3), for parallel work (default false).

Parameters

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

Returns

The same instance.