ProgressColumns
ConsoleMonster.Widgets
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
- The widest it gets (default 40).
- shape ConsoleMonster.Widgets.BarShape = Line
- The bar shape.
public static ProgressColumn Count() #Done of total (12/30), or the count alone when the total is unknown.
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
- The column name.
- render System.Func<ConsoleMonster.Widgets.ProgressRow, ConsoleMonster.Canvas.RenderContext, ConsoleMonster.Text.StyledLine>
- Renders a row.
- maxWidth int = 0
- The widest it gets, or 0 for the widest row.
- priority int = 50
- The drop priority when narrow (higher stays longer).
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
- The column name.
- text System.Func<ConsoleMonster.Widgets.ProgressRow, string>
- Returns the plain text for a row.
- maxWidth int = 0
- The widest it gets, or 0 for the widest row.
- priority int = 50
- The drop priority when narrow (higher stays longer).
public static ProgressColumn Description(int maxWidth = 28) #The label (rich text kept; muted while pending).
Parameters
- maxWidth int = 28
- The widest it gets (default 28).
public static ProgressColumn Elapsed() #The time spent so far (the total time once finished).
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>
- The names (see ProgressColumns.TryCreate).
Exceptions
ArgumentException– A name is not a built-in column.
public static ProgressColumn Percent() #The percentage done.
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
- Whether the amounts are bytes.
- unit string? = null
- A unit after the number for items (files gives 12 files/s), or null.
public static ProgressColumn Remaining() #The estimated time left (12s left) from the smoothed rate; empty when it cannot be estimated.
public static ProgressColumn Results() #Pass, fail and warning counts (✓12 ✗1 ⚠0).
public static ProgressColumn Spinner() #A spinner while running, the status marker once finished.
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.
public static ProgressColumn Status() #The detail while running, done in 12s once finished, queued while pending. It takes leftover width.
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
- The name, case-insensitive.
- column ConsoleMonster.Widgets.ProgressColumn?
- The column.
Returns
bool Whether the name is known.Inherited Methods
Properties
public static IReadOnlyList<string> Names { get; } #The names ProgressColumns.TryCreate accepts.