RhSolutions-AddIn/src/Interface/ProgressBar.cs
2022-04-01 17:55:36 +03:00

27 lines
675 B
C#

namespace RehauSku.Interface
{
internal class ProgressBar : AbstractBar
{
private double CurrentProgress { get; set; }
private readonly double TaskWeight;
private readonly string Message;
public ProgressBar(string message, int weight)
{
Message = message;
TaskWeight = weight;
CurrentProgress = 0;
}
public override void Update()
{
double percent = (++CurrentProgress / TaskWeight) * 100;
if (percent < 100)
{
Excel.StatusBar = $"{Message} Выполнено {percent:#.#} %";
}
}
}
}