ActivityList
ConsoleMonster.Widgets
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
- LiveWidget
- ActivityList
Usage
Explore 15 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 7
- Method Ui.ActivityList
- Extension method ActivityList.MaxVisible
- Extension method ActivityList.ShowElapsed
- Extension method ActivityList.ShowIds
- Method ActivityListFluent.MaxVisible
- Method ActivityListFluent.ShowElapsed
- Method ActivityListFluent.ShowIds
Accepted by parameters 8
- Method ContentBuilder.ActivityList
- Method ContentBuilder.ActivityList
- Extension method ActivityList.MaxVisible
- Extension method ActivityList.ShowElapsed
- Extension method ActivityList.ShowIds
- Method ActivityListFluent.MaxVisible
- Method ActivityListFluent.ShowElapsed
- Method ActivityListFluent.ShowIds
Constructors
public ActivityList(string widgetId = "$progress") #Creates an activity list.
Parameters
- widgetId string = "$progress"
- The target name (default ActivityList.ProgressTarget).
Methods
public override void Apply(LiveEvent liveEvent) #Applies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- 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
- 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
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
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
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public bool TryGetTaskbarProgress(out TaskbarState state, out double fraction) #The widget's contribution, if any.
Parameters
- state ConsoleMonster.Output.TaskbarState
- The state (Normal, Indeterminate, Error or Paused).
- fraction double
- The fraction done (0 to 1), or NaN when unknown.
Returns
bool False when the widget has nothing to report.Inherited Methods
Properties
public int MaxVisible { get; set; } #The most activities shown (default 8); more are summarised in one line.
public bool ShowElapsed { get; set; } #Whether each row ends with the time since the activity started, right-aligned (default true).
public bool ShowIds { get; set; } #Whether each row starts with the activity's id (#3), for parallel work (default false).
Inherited Properties
Fields
public const string ProgressTarget #The target name the PowerShell progress bridge posts to.
$progressExtension Methods
public static ActivityList MaxVisible(ActivityList activityList, int value) #Sets ActivityList.MaxVisible: The most activities shown (default 8); more are summarised in one line.
Parameters
- activityList ConsoleMonster.Widgets.ActivityList
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ActivityList { MaxVisible = value }; Ui.ActivityList().MaxVisible(value);public static ActivityList ShowElapsed(ActivityList activityList, bool value = true) #Sets ActivityList.ShowElapsed: Whether each row ends with the time since the activity started, right-aligned (default true).
Parameters
- activityList ConsoleMonster.Widgets.ActivityList
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ActivityList { ShowElapsed = value }; Ui.ActivityList().ShowElapsed(value);public static ActivityList ShowIds(ActivityList activityList, bool value = true) #Sets ActivityList.ShowIds: Whether each row starts with the activity's id (#3), for parallel work (default false).
Parameters
- activityList ConsoleMonster.Widgets.ActivityList
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Widgets.ActivityList { ShowIds = value }; Ui.ActivityList().ShowIds(value);