Table of Contents

Class LoadingBar

Namespace
ConsoleAppVisuals.AnimatedElements
Assembly
ConsoleAppVisuals.dll

The LoadingBar is a passive element that displays a loading bar using a reference to a progress variable.

public class LoadingBar : AnimatedElement
Inheritance
LoadingBar
Inherited Members

Remarks

For more information, consider visiting the documentation available here.

Constructors

LoadingBar(string, ref float, Placement, int)

The LoadingBar is a passive element that displays a loading bar using a reference to a progress variable.

public LoadingBar(string text, ref float progress, Placement placement = Placement.TopCenter, int additionalDuration = 1000)

Parameters

text string

The text of the loading bar.

progress float

The reference of the progress of the loading bar (that means that you should put a reference to a variable that will contain the percentage of progress of your process).

placement Placement

The placement of the loading bar.

additionalDuration int

The duration of the loading bar after the process.

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

int

Height

Gets the height of the loading bar.

public override int Height { get; }

Property Value

int

Remarks

One line for the text,one line for the space between and one line for the progress.

Placement

Gets the placement of the loading bar.

public override Placement Placement { get; }

Property Value

Placement

Progress

Gets the progress of the loading bar.

public float Progress { get; }

Property Value

float

Text

Gets the text of the loading bar.

public string Text { get; }

Property Value

string

Width

Gets the width of the loading bar.

public override int Width { get; }

Property Value

int

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 int

The new additional duration of the loading bar.

Remarks

For more information, consider visiting the documentation available here.

Exceptions

ArgumentException

The additional duration of the loading bar cannot be negative.

UpdatePlacement(Placement)

Updates the placement of the loading bar.

public void UpdatePlacement(Placement placement)

Parameters

placement Placement

The new placement of the loading bar.

Remarks

For more information, consider visiting the documentation available here.

UpdateProgress(float)

Updates the progress of the loading bar.

public void UpdateProgress(float progress)

Parameters

progress float

The new progress of the loading bar.

Remarks

For more information, consider visiting the documentation available here.

UpdateText(string)

Updates the text of the loading bar.

public void UpdateText(string text)

Parameters

text string

The new text of the loading bar.

Remarks

For more information, consider visiting the documentation available here.