PromptPlus API:IControlProgressBar
IControlProgressBar<T>
Namespace: PPlus.Controls
Represents the interface with all Methods of the ProgressBar control
public interface IControlProgressBar<T> : IPromptControls<ResultProgessBar<T>>
Type Parameters
T
typeof return
Implements IPromptControls<ResultProgessBar<T>>
Methods
ChangeColor(Func<Double, Style>)
Dynamically change Style in ProgressBar
IControlProgressBar<T> ChangeColor(Func<Double, Style> value)
Parameters
value
Func<Double, Style>
function to change color
Returns
ChangeGradient(params Color[])
Dynamically Change Gradient color in ProgressBar
IControlProgressBar<T> ChangeGradient(params Color[] colors)
Parameters
colors
Color[]
list of colors Gradient
Returns
CharBar(Char)
Set Char to show ProgressBar.Default value ‘#’
Valid on ProgressBarType.Char, otherwise is ignored
IControlProgressBar<T> CharBar(char value)
Parameters
value
Char
Char to show
Returns
Config(Action<IPromptConfig>)
Custom config the control.
IControlProgressBar<T> Config(Action<IPromptConfig> context)
Parameters
context
Action<IPromptConfig>
action to apply changes. IPromptConfig
Returns
Culture(CultureInfo)
CultureInfo to on show value format.
IControlProgressBar<T> Culture(CultureInfo value)
Parameters
value
CultureInfo
CultureInfo to use
Returns
Culture(String)
CultureInfo to show value format.
Default value is global Promptplus Cultureinfo
IControlProgressBar<T> Culture(string value)
Parameters
value
String
Name of CultureInfo to use
Returns
Default(Double)
Initial value
IControlProgressBar<T> Default(double value)
Parameters
value
Double
value
Returns
Finish(String)
Finish answer to show when ProgressBar is completed.
IControlProgressBar<T> Finish(string text)
Parameters
text
String
text Finish answer
Returns
FracionalDig(Int32)
Define the Fracional Digits of value. Default is 0.
IControlProgressBar<T> FracionalDig(int value)
Parameters
value
Int32
Fracional Digits
Returns
HideElements(HideProgressBar)
Hide elements in ProgressBar. Default is Show all elements
For more one element use ‘|’ separate (Enum Flag)
IControlProgressBar<T> HideElements(HideProgressBar value)
Parameters
value
HideProgressBar
element to hide. HideProgressBar
Returns
Spinner(SpinnersType, Nullable<Int32>, IEnumerable<String>)
Overwrite SpinnersType. Default value is SpinnersType.Ascii
When use custom spinner, if has unicode values console does not support it, the rendering may not be as expected
IControlProgressBar<T> Spinner(SpinnersType spinnersType, Nullable<Int32> speedAnimation, IEnumerable<String> customspinner)
Parameters
spinnersType
SpinnersType
The SpinnersType
speedAnimation
Nullable<Int32>
Number of mileseconds foreach iteration of spinner. Valid only to SpinnersType.custom, otherwise will be ignored
customspinner
IEnumerable<String>
IEnumerable values for custom spinner. Valid only to SpinnersType.custom, otherwise will be ignored
Returns
Styles(ProgressBarStyles, Style)
Overwrite Styles
IControlProgressBar<T> Styles(ProgressBarStyles content, Style value)
Parameters
content
ProgressBarStyles
ProgressBarStyles of content
Returns
UpdateHandler(Action<UpdateProgressBar<T>, CancellationToken>)
Handler to execute Update values in ProgressBar.
IControlProgressBar<T> UpdateHandler(Action<UpdateProgressBar<T>, CancellationToken> value)
Parameters
value
Action<UpdateProgressBar<T>, CancellationToken>
Handler.See UpdateProgressBar<T> to change value
Returns
Width(Int32)
Define Width to ProgressBar. Default value is 80.The value must be greater than or equal to 10.
IControlProgressBar<T> Width(int value)
Parameters
value
Int32
Width