Skip to content
ConsoleMonster
Class

ProgressColumns

ConsoleMonster.Widgets

Namespace
ConsoleMonster.Widgets
Assembly
ConsoleMonster
Modifiers
static

The built-in progress columns. Each call returns a new column, so its ProgressColumn.Priority, ProgressColumn.MaxWidth and alignment can be changed per display.

Inheritance

  • object
  • ProgressColumns

Methods

public static ProgressColumn Bar(int maxWidth = 40, BarShape shape = Line) #

The bar; it takes the width the fixed columns leave.

Parameters

maxWidth int = 40 optional
The widest it gets (default 40).
shape ConsoleMonster.Widgets.BarShape = Line optional
The bar shape.

Returns

ProgressColumn The column.
public static ProgressColumn Count() #

Done of total (12/30), or the count alone when the total is unknown.

Returns

ProgressColumn The column.
Custom 2 overloads
public static ProgressColumn Custom(string name, Func<ProgressRow, RenderContext, StyledLine> render, int maxWidth = 0, int priority = 50) #

A custom column from a delegate.

Parameters

name string required
The column name.
render System.Func<ConsoleMonster.Widgets.ProgressRow, ConsoleMonster.Canvas.RenderContext, ConsoleMonster.Text.StyledLine> required
Renders a row.
maxWidth int = 0 optional
The widest it gets, or 0 for the widest row.
priority int = 50 optional
The drop priority when narrow (higher stays longer).

Returns

ProgressColumn The column.
public static ProgressColumn Custom(string name, Func<ProgressRow, string> text, int maxWidth = 0, int priority = 50) #

A custom text column from a delegate.

Parameters

name string required
The column name.
text System.Func<ConsoleMonster.Widgets.ProgressRow, string> required
Returns the plain text for a row.
maxWidth int = 0 optional
The widest it gets, or 0 for the widest row.
priority int = 50 optional
The drop priority when narrow (higher stays longer).

Returns

ProgressColumn The column.
public static ProgressColumn Description(int maxWidth = 28) #

The label (rich text kept; muted while pending).

Parameters

maxWidth int = 28 optional
The widest it gets (default 28).

Returns

ProgressColumn The column.
public static ProgressColumn Elapsed() #

The time spent so far (the total time once finished).

Returns

ProgressColumn The column.
public static IList<ProgressColumn> FromNames(IEnumerable<string> names) #

Built-in columns by name, in order; Standard expands to ProgressColumns.Standard.

Parameters

names System.Collections.Generic.IEnumerable<string> required
The names (see ProgressColumns.TryCreate).

Returns

IList<ProgressColumn> A new list.

Exceptions

  • ArgumentException – A name is not a built-in column.
public static ProgressColumn Percent() #

The percentage done.

Returns

ProgressColumn The column.
public static ProgressColumn Rate(bool bytes = false, string? unit = null) #

The smoothed rate: items per second, or bytes per second (1.5 MB/s) with bytes.

Parameters

bytes bool = false optional
Whether the amounts are bytes.
unit string? = null optional
A unit after the number for items (files gives 12 files/s), or null.

Returns

ProgressColumn The column.
public static ProgressColumn Remaining() #

The estimated time left (12s left) from the smoothed rate; empty when it cannot be estimated.

Returns

ProgressColumn The column.
public static ProgressColumn Results() #

Pass, fail and warning counts (✓12 ✗1 ⚠0).

Returns

ProgressColumn The column.
public static ProgressColumn Spinner() #

A spinner while running, the status marker once finished.

Returns

ProgressColumn The column.
public static IList<ProgressColumn> Standard() #

The usual set: spinner, description, bar, percent, count, elapsed, remaining time and status text. Narrow regions drop the status text, rate, elapsed time, count and remaining time first, then the percentage.

Returns

IList<ProgressColumn> A new list.
public static ProgressColumn Status() #

The detail while running, done in 12s once finished, queued while pending. It takes leftover width.

Returns

ProgressColumn The column.
public static bool TryCreate(string name, out ProgressColumn? column) #

A built-in column by name (Spinner, Description, Bar, Percent, Count, Elapsed, Remaining, Rate, ByteRate, Results, Status).

Parameters

name string required
The name, case-insensitive.
column ConsoleMonster.Widgets.ProgressColumn? required
The column.

Returns

bool Whether the name is known.

Properties

public static IReadOnlyList<string> Names { get; } #

The names ProgressColumns.TryCreate accepts.