Class ProgressBar
Progress bar with text
Namespace: Terminaux.Writer.CyclicWriters.Simple
Assembly: Terminaux.dll
Syntax
public class ProgressBar : SimpleCyclicWriter
Constructors
| Edit this page View SourceProgressBar(Mark, int, int, Spinner?, TextMarquee?, params object?[]?)
Makes a new instance of progress bar
Declaration
public ProgressBar(Mark text, int position, int maxPosition, Spinner? progressSpinner = null, TextMarquee? progressMarquee = null, params object?[]? args)
Parameters
| Type | Name | Description |
|---|---|---|
| Mark | text | Text to render. All VT sequences and control characters are trimmed away. |
| int | position | Current position |
| int | maxPosition | Max position |
| Spinner | progressSpinner | Spinner instance to use, or SpinMore |
| TextMarquee | progressMarquee | Marquee writer to use |
| object[] | args | Arguments to format the string with |
Properties
| Edit this page View SourceAccurate
Specifies whether the progress bar uses unicode block characters to accurately describe progress or not.
Declaration
public bool Accurate { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
If Indeterminate is true, this won't be applied.
Delay
Delay interval for marquee. The default is 30 ticks for 100 milliseconds, but you can adjust it, depending on the speed of the loop.
Declaration
public int Delay { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Indeterminate
Specifies whether the progress is indeterminate
Declaration
public bool Indeterminate { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Position
Position of the progress bar
Declaration
public int Position { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
ProgressActiveForegroundColor
Progress active foreground
Declaration
public Color ProgressActiveForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressBackgroundColor
Progress background
Declaration
public Color ProgressBackgroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressFailedActiveForegroundColor
Progress failed active foreground
Declaration
public Color ProgressFailedActiveForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressFailedForegroundColor
Progress failed foreground
Declaration
public Color ProgressFailedForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressForegroundColor
Progress foreground
Declaration
public Color ProgressForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressHorizontalActiveTrackChar
Progress horizontal active track character for drawing
Declaration
public char ProgressHorizontalActiveTrackChar { get; set; }
Property Value
| Type | Description |
|---|---|
| char |
Remarks
If Accurate is enabled, this property is ignored.
ProgressHorizontalInactiveTrackChar
Progress horizontal inactive track character for drawing
Declaration
public char ProgressHorizontalInactiveTrackChar { get; set; }
Property Value
| Type | Description |
|---|---|
| char |
Remarks
If Accurate is enabled, this property is ignored.
ProgressPausedActiveForegroundColor
Progress paused active foreground
Declaration
public Color ProgressPausedActiveForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressPausedForegroundColor
Progress paused foreground
Declaration
public Color ProgressPausedForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressPercentageTextColor
Progress percentage text color
Declaration
public Color ProgressPercentageTextColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressSpinnerTextColor
Progress spinner color
Declaration
public Color ProgressSpinnerTextColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressTextColor
Progress text color
Declaration
public Color ProgressTextColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressUncoloredHorizontalActiveTrackChar
Progress horizontal active track character for drawing (uncolored)
Declaration
public char ProgressUncoloredHorizontalActiveTrackChar { get; set; }
Property Value
| Type | Description |
|---|---|
| char |
Remarks
If Accurate is enabled, this property is ignored.
ProgressUncoloredHorizontalInactiveTrackChar
Progress horizontal inactive track character for drawing (uncolored)
Declaration
public char ProgressUncoloredHorizontalInactiveTrackChar { get; set; }
Property Value
| Type | Description |
|---|---|
| char |
Remarks
If Accurate is enabled, this property is ignored.
ProgressUncoloredVerticalActiveTrackChar
Progress vertical active track character for drawing (uncolored)
Declaration
public char ProgressUncoloredVerticalActiveTrackChar { get; set; }
Property Value
| Type | Description |
|---|---|
| char |
Remarks
If Accurate is enabled, this property is ignored.
ProgressUncoloredVerticalInactiveTrackChar
Progress vertical inactive track character for drawing (uncolored)
Declaration
public char ProgressUncoloredVerticalInactiveTrackChar { get; set; }
Property Value
| Type | Description |
|---|---|
| char |
Remarks
If Accurate is enabled, this property is ignored.
ProgressVerticalActiveTrackChar
Progress vertical active track character for drawing
Declaration
public char ProgressVerticalActiveTrackChar { get; set; }
Property Value
| Type | Description |
|---|---|
| char |
Remarks
If Accurate is enabled, this property is ignored.
ProgressVerticalInactiveTrackChar
Progress vertical inactive track character for drawing
Declaration
public char ProgressVerticalInactiveTrackChar { get; set; }
Property Value
| Type | Description |
|---|---|
| char |
Remarks
If Accurate is enabled, this property is ignored.
ProgressWarningActiveForegroundColor
Progress warning active foreground
Declaration
public Color ProgressWarningActiveForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ProgressWarningForegroundColor
Progress warning foreground
Declaration
public Color ProgressWarningForegroundColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color |
ShowPercentage
Specifies whether the progress bar shows percentage or not (ignored in indeterminate progress bars)
Declaration
public bool ShowPercentage { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
State
State of the progress bar
Declaration
public ProgressState State { get; set; }
Property Value
| Type | Description |
|---|---|
| ProgressState |
Text
Text to render. All VT sequences and control characters are trimmed away.
Declaration
public string Text { get; }
Property Value
| Type | Description |
|---|---|
| string |
UseColors
Whether to use colors or not
Declaration
public bool UseColors { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Width
Width of the progress bar
Declaration
public int Width { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
| Edit this page View SourceRender()
Renders a scrolling text progress bar
Declaration
public override string Render()
Returns
| Type | Description |
|---|---|
| string | The result |