API Reference
ProgressBar
A labelled progress bar with percentage and count: Build ████████▌░░░░ 64% 32/50. Live operations: set (Value, Total), advance (Value = amount), label (Text), state (State).
Inheritance
- LiveWidget
- ProgressBar
Usage
Explore 49 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 25
- Method Ui.Progress
- Extension method ProgressBar.AddColumn
- Extension method ProgressBar.AddColumns
- Extension method ProgressBar.WithColumns
- Extension method ProgressBar.WithCountColumn
- Extension method ProgressBar.WithLabel
- Extension method ProgressBar.WithLabelWidth
- Extension method ProgressBar.WithRateWindow
- Extension method ProgressBar.WithShape
- Extension method ProgressBar.WithShowCount
- Extension method ProgressBar.WithStatus
- Extension method ProgressBar.WithTotal
- Extension method ProgressBar.WithValue
- Method ProgressBarFluent.AddColumn
- Method ProgressBarFluent.AddColumns
- Method ProgressBarFluent.WithColumns
- Method ProgressBarFluent.WithCountColumn
- Method ProgressBarFluent.WithLabel
- Method ProgressBarFluent.WithLabelWidth
- Method ProgressBarFluent.WithRateWindow
- Method ProgressBarFluent.WithShape
- Method ProgressBarFluent.WithShowCount
- Method ProgressBarFluent.WithStatus
- Method ProgressBarFluent.WithTotal
- Method ProgressBarFluent.WithValue
Accepted by parameters 24
- Extension method ProgressBar.AddColumn
- Extension method ProgressBar.AddColumns
- Extension method ProgressBar.WithColumns
- Extension method ProgressBar.WithCountColumn
- Extension method ProgressBar.WithLabel
- Extension method ProgressBar.WithLabelWidth
- Extension method ProgressBar.WithRateWindow
- Extension method ProgressBar.WithShape
- Extension method ProgressBar.WithShowCount
- Extension method ProgressBar.WithStatus
- Extension method ProgressBar.WithTotal
- Extension method ProgressBar.WithValue
- Method ProgressBarFluent.AddColumn
- Method ProgressBarFluent.AddColumns
- Method ProgressBarFluent.WithColumns
- Method ProgressBarFluent.WithCountColumn
- Method ProgressBarFluent.WithLabel
- Method ProgressBarFluent.WithLabelWidth
- Method ProgressBarFluent.WithRateWindow
- Method ProgressBarFluent.WithShape
- Method ProgressBarFluent.WithShowCount
- Method ProgressBarFluent.WithStatus
- Method ProgressBarFluent.WithTotal
- Method ProgressBarFluent.WithValue
Constructors
public ProgressBar(String label = "", String name = "progress") #Creates a progress bar.
Parameters
- label System.String = ""
- The label (markup).
- name System.String = "progress"
- The live name (default progress).
Methods
public override Void Apply(LiveEvent liveEvent) #VoidApplies an event to the widget's state.
Parameters
- liveEvent ConsoleMonster.Live.LiveEvent
- The event.
public override String? Describe(LiveEvent liveEvent) #String?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
A plain line or null.
public String? GetSummaryLine() #String?Returns the current status, or null to omit this target from the heartbeat.
Returns
The plain-text status line.
public ProgressHandle Handle(ILiveDispatcher dispatcher) #ProgressHandleReturns a handle that updates this bar through a dispatcher.
Parameters
- dispatcher ConsoleMonster.Live.ILiveDispatcher
- The dispatcher.
Returns
The handle.
public override Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public override Void Render(Region region, RenderContext context) #VoidRenders 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 Boolean TryGetTaskbarProgress(out TaskbarState state, out Double fraction) #BooleanThe widget's contribution, if any.
Parameters
- state ConsoleMonster.Output.TaskbarState
- The state (Normal, Indeterminate, Error or Paused).
- fraction System.Double
- The fraction done (0 to 1), or NaN when unknown.
Returns
False when the widget has nothing to report.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public StatusKind Status { get; set; } #The status; Pass/Fail/Warn change the bar colour once finished.
public Boolean ShowCount { get; set; } #Whether the value/total count is shown (default true).
public BarShape Shape { get; set; } #The bar shape: BarShape.Line (default, a thin stroke) or BarShape.Block (solid blocks).
public ColumnFormat CountColumn { get; set; } #Layout of the value in the value/total count (default right-aligned). The value reserves the width of the total, so the bar keeps its length as the value grows from 9 to 10.
public Int32? LabelWidth { get; set; } #A fixed label column width, or null to fit the label.
public IList<ProgressColumn>? Columns { get; set; } #The columns of the bar's row (see ProgressColumns: description, bar, percent, count, elapsed, remaining time, rate, custom...), or null (default) for the classic label, bar, percentage and count. With columns set, the stream heartbeat line summarises the bar through them.
public TimeSpan RateWindow { get; set; } #The moving window that smooths the rate and the remaining time (default 10 seconds).
Inherited Properties
Extension Methods
public static ProgressBar AddColumn(ProgressBar progressBar, ProgressColumn item) #ProgressBarAdds an item to ProgressBar.Columns: The columns of the bar's row (see ProgressColumns: description, bar, percent, count, elapsed, remaining time, rate, custom...), or null (default) for the classic label, bar, percentage and count. With columns set, the stream heartbeat line summarises the bar through them.
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- item ConsoleMonster.Widgets.ProgressColumn
- The item.
Returns
The same instance.
public static ProgressBar AddColumns(ProgressBar progressBar, params ProgressColumn[] items) #ProgressBarAdds items to ProgressBar.Columns: The columns of the bar's row (see ProgressColumns: description, bar, percent, count, elapsed, remaining time, rate, custom...), or null (default) for the classic label, bar, percentage and count. With columns set, the stream heartbeat line summarises the bar through them.
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- items ConsoleMonster.Widgets.ProgressColumn[]
- The items, in order.
Returns
The same instance.
public static ProgressBar AddColumns(ProgressBar progressBar, IEnumerable<ProgressColumn> items) #ProgressBarAdds items to ProgressBar.Columns: The columns of the bar's row (see ProgressColumns: description, bar, percent, count, elapsed, remaining time, rate, custom...), or null (default) for the classic label, bar, percentage and count. With columns set, the stream heartbeat line summarises the bar through them.
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- items System.Collections.Generic.IEnumerable<ConsoleMonster.Widgets.ProgressColumn>
- The items, in order.
Returns
The same instance.
public static ProgressBar WithColumns(ProgressBar progressBar, IList<ProgressColumn>? value) #ProgressBarSets ProgressBar.Columns: The columns of the bar's row (see ProgressColumns: description, bar, percent, count, elapsed, remaining time, rate, custom...), or null (default) for the classic label, bar, percentage and count. With columns set, the stream heartbeat line summarises the bar through them.
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value System.Collections.Generic.IList<ConsoleMonster.Widgets.ProgressColumn>?
- The value.
Returns
The same instance.
public static ProgressBar WithCountColumn(ProgressBar progressBar, ColumnFormat value) #ProgressBarSets ProgressBar.CountColumn: Layout of the value in the value/total count (default right-aligned). The value reserves the width of the total, so the bar keeps its length as the value grows from 9 to 10.
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value ConsoleMonster.Layout.ColumnFormat
- The value.
Returns
The same instance.
public static ProgressBar WithCountColumn(ProgressBar progressBar, Action<ColumnFormat> configure) #ProgressBarConfigures ProgressBar.CountColumn in place: Layout of the value in the value/total count (default right-aligned). The value reserves the width of the total, so the bar keeps its length as the value grows from 9 to 10.
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- configure System.Action<ConsoleMonster.Layout.ColumnFormat>
- Configures the value.
Returns
The same instance.
public static ProgressBar WithLabel(ProgressBar progressBar, String value) #ProgressBarSets ProgressBar.Label: The label (markup).
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value System.String
- The value.
Returns
The same instance.
public static ProgressBar WithLabelWidth(ProgressBar progressBar, Int32? value) #ProgressBarSets ProgressBar.LabelWidth: A fixed label column width, or null to fit the label.
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value System.Int32?
- The value.
Returns
The same instance.
public static ProgressBar WithRateWindow(ProgressBar progressBar, TimeSpan value) #ProgressBarSets ProgressBar.RateWindow: The moving window that smooths the rate and the remaining time (default 10 seconds).
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value System.TimeSpan
- The value.
Returns
The same instance.
public static ProgressBar WithShape(ProgressBar progressBar, BarShape value) #ProgressBarSets ProgressBar.Shape: The bar shape: BarShape.Line (default, a thin stroke) or BarShape.Block (solid blocks).
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value ConsoleMonster.Widgets.BarShape
- The value.
Returns
The same instance.
public static ProgressBar WithShowCount(ProgressBar progressBar, Boolean value = true) #ProgressBarSets ProgressBar.ShowCount: Whether the value/total count is shown (default true).
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static ProgressBar WithStatus(ProgressBar progressBar, StatusKind value) #ProgressBarSets ProgressBar.Status: The status; Pass/Fail/Warn change the bar colour once finished.
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value ConsoleMonster.Styling.StatusKind
- The value.
Returns
The same instance.
public static ProgressBar WithTotal(ProgressBar progressBar, Double value) #ProgressBarSets ProgressBar.Total: The total (default 100).
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value System.Double
- The value.
Returns
The same instance.
public static ProgressBar WithValue(ProgressBar progressBar, Double value) #ProgressBarSets ProgressBar.Value: The current value.
Parameters
- progressBar ConsoleMonster.Widgets.ProgressBar
- The instance.
- value System.Double
- The value.
Returns
The same instance.