Skip to the content.

PromptPlus API:IControlProgressBar

Build Publish License NuGet Downloads

Back to List Api

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

IControlProgressBar<T>

ChangeGradient(params Color[])

Dynamically Change Gradient color in ProgressBar

IControlProgressBar<T> ChangeGradient(params Color[] colors)

Parameters

colors Color[]
list of colors Gradient

Returns

IControlProgressBar<T>

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

IControlProgressBar<T>

Config(Action<IPromptConfig>)

Custom config the control.

IControlProgressBar<T> Config(Action<IPromptConfig> context)

Parameters

context Action<IPromptConfig>
action to apply changes. IPromptConfig

Returns

IControlProgressBar<T>

Culture(CultureInfo)

CultureInfo to on show value format.

IControlProgressBar<T> Culture(CultureInfo value)

Parameters

value CultureInfo
CultureInfo to use

Returns

IControlProgressBar<T>

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

IControlProgressBar<T>

Default(Double)

Initial value

IControlProgressBar<T> Default(double value)

Parameters

value Double
value

Returns

IControlProgressBar<T>

Finish(String)

Finish answer to show when ProgressBar is completed.

IControlProgressBar<T> Finish(string text)

Parameters

text String
text Finish answer

Returns

IControlProgressBar<T>

FracionalDig(Int32)

Define the Fracional Digits of value. Default is 0.

IControlProgressBar<T> FracionalDig(int value)

Parameters

value Int32
Fracional Digits

Returns

IControlProgressBar<T>

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

IControlProgressBar<T>

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

IControlProgressBar<T>

Styles(ProgressBarStyles, Style)

Overwrite Styles

IControlProgressBar<T> Styles(ProgressBarStyles content, Style value)

Parameters

content ProgressBarStyles
ProgressBarStyles of content

value Style
The Style

Returns

IControlProgressBar<T>

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

IControlProgressBar<T>

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

Returns

IControlProgressBar<T>


Back to List Api