Skip to content
ConsoleMonster

API Reference

Class

ProgressColumns

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(Int32 maxWidth = 40, BarShape shape = Line) #
Returns: ProgressColumn

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

Parameters

maxWidth System.Int32 = 40 optionalposition: 0
The widest it gets (default 40).
shape ConsoleMonster.Widgets.BarShape = Line optionalposition: 1
The bar shape.

Returns

The column.

public static ProgressColumn Count() #
Returns: ProgressColumn

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

Returns

The column.

Custom 2 overloads
public static ProgressColumn Custom(String name, Func<ProgressRow, RenderContext, StyledLine> render, Int32 maxWidth = 0, Int32 priority = 50) #
Returns: ProgressColumn

A custom column from a delegate.

Parameters

name System.String requiredposition: 0
The column name.
render System.Func<ConsoleMonster.Widgets.ProgressRow, ConsoleMonster.Canvas.RenderContext, ConsoleMonster.Text.StyledLine> requiredposition: 1
Renders a row.
maxWidth System.Int32 = 0 optionalposition: 2
The widest it gets, or 0 for the widest row.
priority System.Int32 = 50 optionalposition: 3
The drop priority when narrow (higher stays longer).

Returns

The column.

public static ProgressColumn Custom(String name, Func<ProgressRow, String> text, Int32 maxWidth = 0, Int32 priority = 50) #
Returns: ProgressColumn

A custom text column from a delegate.

Parameters

name System.String requiredposition: 0
The column name.
text System.Func<ConsoleMonster.Widgets.ProgressRow, System.String> requiredposition: 1
Returns the plain text for a row.
maxWidth System.Int32 = 0 optionalposition: 2
The widest it gets, or 0 for the widest row.
priority System.Int32 = 50 optionalposition: 3
The drop priority when narrow (higher stays longer).

Returns

The column.

public static ProgressColumn Description(Int32 maxWidth = 28) #
Returns: ProgressColumn

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

Parameters

maxWidth System.Int32 = 28 optionalposition: 0
The widest it gets (default 28).

Returns

The column.

public static ProgressColumn Elapsed() #
Returns: ProgressColumn

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

Returns

The column.

public static IList<ProgressColumn> FromNames(IEnumerable<String> names) #
Returns: IList<ProgressColumn>

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

Parameters

names System.Collections.Generic.IEnumerable<System.String> requiredposition: 0
The names (see ProgressColumns.TryCreate).

Returns

A new list.

Exceptions

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

The percentage done.

Returns

The column.

public static ProgressColumn Rate(Boolean bytes = false, String? unit = null) #
Returns: ProgressColumn

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

Parameters

bytes System.Boolean = false optionalposition: 0
Whether the amounts are bytes.
unit System.String? = null optionalposition: 1
A unit after the number for items (files gives 12 files/s), or null.

Returns

The column.

public static ProgressColumn Remaining() #
Returns: ProgressColumn

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

Returns

The column.

public static ProgressColumn Results() #
Returns: ProgressColumn

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

Returns

The column.

public static ProgressColumn Spinner() #
Returns: ProgressColumn

A spinner while running, the status marker once finished.

Returns

The column.

public static IList<ProgressColumn> Standard() #
Returns: IList<ProgressColumn>

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

A new list.

public static ProgressColumn Status() #
Returns: ProgressColumn

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

Returns

The column.

public static Boolean TryCreate(String name, out ProgressColumn? column) #
Returns: Boolean

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

Parameters

name System.String requiredposition: 0
The name, case-insensitive.
column ConsoleMonster.Widgets.ProgressColumn? requiredposition: 1
The column.

Returns

Whether the name is known.

Properties

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

The names ProgressColumns.TryCreate accepts.