Class ProgressBarBuilder
- Namespace
- SharpConsoleUI.Builders
- Assembly
- SharpConsoleUI.dll
Fluent builder for creating ProgressBarControl instances.
public class ProgressBarBuilder
- Inheritance
-
ProgressBarBuilder
- Inherited Members
Constructors
ProgressBarBuilder()
Initializes a new instance of the ProgressBarBuilder class.
public ProgressBarBuilder()
Methods
Build()
Builds the ProgressBarControl instance.
public ProgressBarControl Build()
Returns
Indeterminate(bool)
Enables or disables indeterminate (pulsing) mode.
public ProgressBarBuilder Indeterminate(bool indeterminate = true)
Parameters
indeterminatebool
Returns
ShowHeader(bool)
Sets whether to show the header.
public ProgressBarBuilder ShowHeader(bool show = true)
Parameters
showbool
Returns
ShowPercentage(bool)
Sets whether to show the percentage text.
public ProgressBarBuilder ShowPercentage(bool show = true)
Parameters
showbool
Returns
StickyBottom()
Makes the control stick to the bottom during scrolling.
public ProgressBarBuilder StickyBottom()
Returns
StickyTop()
Makes the control stick to the top during scrolling.
public ProgressBarBuilder StickyTop()
Returns
Stretch()
Sets the bar to stretch to fill available width.
public ProgressBarBuilder Stretch()
Returns
Visible(bool)
Sets the visibility.
public ProgressBarBuilder Visible(bool visible)
Parameters
visiblebool
Returns
WithAlignment(HorizontalAlignment)
Sets the horizontal alignment.
public ProgressBarBuilder WithAlignment(HorizontalAlignment alignment)
Parameters
alignmentHorizontalAlignment
Returns
WithAnimationInterval(int)
Sets the animation interval in milliseconds for indeterminate mode.
public ProgressBarBuilder WithAnimationInterval(int milliseconds)
Parameters
millisecondsint
Returns
WithBackgroundColor(Color)
Sets the background color.
public ProgressBarBuilder WithBackgroundColor(Color color)
Parameters
colorColor
Returns
WithBarWidth(int)
Sets the bar width in characters.
public ProgressBarBuilder WithBarWidth(int width)
Parameters
widthint
Returns
WithColors(Color, Color)
Sets both filled and unfilled colors.
public ProgressBarBuilder WithColors(Color filled, Color unfilled)
Parameters
filledColorunfilledColor
Returns
WithFilledColor(Color)
Sets the filled color.
public ProgressBarBuilder WithFilledColor(Color color)
Parameters
colorColor
Returns
WithHeader(string)
Sets the header text and enables header display.
public ProgressBarBuilder WithHeader(string header)
Parameters
headerstring
Returns
WithMargin(Margin)
Sets the margin.
public ProgressBarBuilder WithMargin(Margin margin)
Parameters
marginMargin
Returns
WithMargin(int, int, int, int)
Sets the margin.
public ProgressBarBuilder WithMargin(int left, int top, int right, int bottom)
Parameters
Returns
WithMaxValue(double)
Sets the maximum value (100% fill).
public ProgressBarBuilder WithMaxValue(double maxValue)
Parameters
maxValuedouble
Returns
WithName(string)
Sets the control name.
public ProgressBarBuilder WithName(string name)
Parameters
namestring
Returns
WithPercentage(double)
Sets the progress as a percentage (sets MaxValue=100 and Value).
public ProgressBarBuilder WithPercentage(double percentage)
Parameters
percentagedouble
Returns
WithPercentageColor(Color)
Sets the percentage text color.
public ProgressBarBuilder WithPercentageColor(Color color)
Parameters
colorColor
Returns
WithPulseWidth(int)
Sets the width of the pulse segment in indeterminate mode.
public ProgressBarBuilder WithPulseWidth(int width)
Parameters
widthint
Returns
WithTag(object)
Sets an arbitrary tag object.
public ProgressBarBuilder WithTag(object tag)
Parameters
tagobject
Returns
WithUnfilledColor(Color)
Sets the unfilled color.
public ProgressBarBuilder WithUnfilledColor(Color color)
Parameters
colorColor
Returns
WithValue(double)
Sets the current value.
public ProgressBarBuilder WithValue(double value)
Parameters
valuedouble
Returns
WithVerticalAlignment(VerticalAlignment)
Sets the vertical alignment.
public ProgressBarBuilder WithVerticalAlignment(VerticalAlignment alignment)
Parameters
alignmentVerticalAlignment
Returns
WithWidth(int)
Sets the width.
public ProgressBarBuilder WithWidth(int width)
Parameters
widthint