Class FakeLoadingBar
- Namespace
- ConsoleAppVisuals.AnimatedElements
- Assembly
- ConsoleAppVisuals.dll
The FakeLoadingBar is an animated element that simulates a loading bar with a fixed duration.
public class FakeLoadingBar : AnimatedElement
- Inheritance
-
FakeLoadingBar
- Inherited Members
Remarks
For more information, consider visiting the documentation available here.
Constructors
FakeLoadingBar(string, int, Placement, int, int, BordersType)
The FakeLoadingBar is an animated element that simulates a loading bar with a fixed duration.
public FakeLoadingBar(string text = "Loading ...", int barWidth = 0, Placement placement = Placement.TopCenter, int processDuration = 2000, int additionalDuration = 1000, BordersType bordersType = BordersType.SingleStraight)
Parameters
text
stringThe text of the loading bar.
barWidth
intThe width of the loading bar. If 0 or less than text length, text length is used.
placement
PlacementThe placement of the loading bar.
processDuration
intThe duration of the loading bar.
additionalDuration
intThe additional duration of the loading bar at the end.
bordersType
BordersTypeThe type of borders to display around the loading bar.
Remarks
For more information, consider visiting the documentation available here.
Properties
AdditionalDuration
Gets the additional duration of the loading bar at the end.
public int AdditionalDuration { get; }
Property Value
BarWidth
Gets the explicit width of the loading bar.
public int BarWidth { get; }
Property Value
Borders
Gets the borders of the loading bar.
public Borders Borders { get; }
Property Value
BordersType
Gets the border type of the loading bar.
public BordersType BordersType { get; }
Property Value
Height
Gets the height of the loading bar.
public override int Height { get; }
Property Value
Placement
Gets the placement of the loading bar.
public override Placement Placement { get; }
Property Value
ProcessDuration
Gets the duration of the loading bar.
public int ProcessDuration { get; }
Property Value
Text
Gets the text of the loading bar.
public string Text { get; }
Property Value
Width
Gets the width of the loading bar.
public override int Width { get; }
Property Value
Methods
RenderElementActions()
Defines the actions to perform when the element is called to be rendered on the console.
[Visual]
protected override void RenderElementActions()
UpdateAdditionalDuration(int)
Updates the additional duration of the loading bar.
public void UpdateAdditionalDuration(int additionalDuration)
Parameters
additionalDuration
intThe new additional duration of the loading bar.
Remarks
For more information, consider visiting the documentation available here.
Exceptions
- ArgumentOutOfRangeException
The additional duration of the loading bar cannot be negative.
UpdateBarWidth(int)
Updates the width of the loading bar.
public void UpdateBarWidth(int barWidth)
Parameters
barWidth
intThe new width of the loading bar. If 0, text length is used.
Remarks
For more information, consider visiting the documentation available here.
UpdateBordersType(BordersType)
Updates the borders type of the loading bar.
public void UpdateBordersType(BordersType bordersType)
Parameters
bordersType
BordersTypeThe new border type of the loading bar.
Remarks
For more information, consider visiting the documentation available here.
UpdatePlacement(Placement)
Updates the placement of the loading bar.
public void UpdatePlacement(Placement placement)
Parameters
placement
PlacementThe new placement of the loading bar.
Remarks
For more information, consider visiting the documentation available here.
UpdateProcessDuration(int)
Updates the duration of the loading bar.
public void UpdateProcessDuration(int processDuration)
Parameters
processDuration
intThe new duration of the loading bar.
Remarks
For more information, consider visiting the documentation available here.
Exceptions
- ArgumentOutOfRangeException
Throw when the process duration is negative.
UpdateText(string)
Updates the text of the loading bar.
public void UpdateText(string text)
Parameters
text
stringThe new text of the loading bar.
Remarks
For more information, consider visiting the documentation available here.