API Reference
ProgressColumns
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) #ProgressColumnThe bar; it takes the width the fixed columns leave.
Parameters
- maxWidth System.Int32 = 40
- The widest it gets (default 40).
- shape ConsoleMonster.Widgets.BarShape = Line
- The bar shape.
Returns
The column.
public static ProgressColumn Count() #ProgressColumnDone of total (12/30), or the count alone when the total is unknown.
Returns
The column.
public static ProgressColumn Custom(String name, Func<ProgressRow, RenderContext, StyledLine> render, Int32 maxWidth = 0, Int32 priority = 50) #ProgressColumnA custom column from a delegate.
Parameters
- name System.String
- The column name.
- render System.Func<ConsoleMonster.Widgets.ProgressRow, ConsoleMonster.Canvas.RenderContext, ConsoleMonster.Text.StyledLine>
- Renders a row.
- maxWidth System.Int32 = 0
- The widest it gets, or 0 for the widest row.
- priority System.Int32 = 50
- 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) #ProgressColumnA custom text column from a delegate.
Parameters
- name System.String
- The column name.
- text System.Func<ConsoleMonster.Widgets.ProgressRow, System.String>
- Returns the plain text for a row.
- maxWidth System.Int32 = 0
- The widest it gets, or 0 for the widest row.
- priority System.Int32 = 50
- The drop priority when narrow (higher stays longer).
Returns
The column.
public static ProgressColumn Description(Int32 maxWidth = 28) #ProgressColumnThe label (rich text kept; muted while pending).
Parameters
- maxWidth System.Int32 = 28
- The widest it gets (default 28).
Returns
The column.
public static ProgressColumn Elapsed() #ProgressColumnThe time spent so far (the total time once finished).
Returns
The column.
public static IList<ProgressColumn> FromNames(IEnumerable<String> names) #IList<ProgressColumn>Built-in columns by name, in order; Standard expands to ProgressColumns.Standard.
Parameters
- names System.Collections.Generic.IEnumerable<System.String>
- The names (see ProgressColumns.TryCreate).
Returns
A new list.
Exceptions
ArgumentException– A name is not a built-in column.
public static ProgressColumn Percent() #ProgressColumnThe percentage done.
Returns
The column.
public static ProgressColumn Rate(Boolean bytes = false, String? unit = null) #ProgressColumnThe smoothed rate: items per second, or bytes per second (1.5 MB/s) with bytes.
Parameters
- bytes System.Boolean = false
- Whether the amounts are bytes.
- unit System.String? = null
- A unit after the number for items (files gives 12 files/s), or null.
Returns
The column.
public static ProgressColumn Remaining() #ProgressColumnThe estimated time left (12s left) from the smoothed rate; empty when it cannot be estimated.
Returns
The column.
public static ProgressColumn Results() #ProgressColumnPass, fail and warning counts (✓12 ✗1 ⚠0).
Returns
The column.
public static ProgressColumn Spinner() #ProgressColumnA spinner while running, the status marker once finished.
Returns
The column.
public static IList<ProgressColumn> Standard() #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() #ProgressColumnThe 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) #BooleanA built-in column by name (Spinner, Description, Bar, Percent, Count, Elapsed, Remaining, Rate, ByteRate, Results, Status).
Parameters
- name System.String
- The name, case-insensitive.
- column ConsoleMonster.Widgets.ProgressColumn?
- The column.
Returns
Whether the name is known.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public static IReadOnlyList<String> Names { get; } #The names ProgressColumns.TryCreate accepts.