2022-12-19 20:25:35 +03:00
|
|
|
|
namespace RhSolutions.Interface
|
2022-02-02 10:23:50 +03:00
|
|
|
|
{
|
2022-12-20 11:53:55 +03:00
|
|
|
|
internal class ProgressBar : StatusbarBase
|
2022-02-02 10:23:50 +03:00
|
|
|
|
{
|
|
|
|
|
private double CurrentProgress { get; set; }
|
|
|
|
|
private readonly double TaskWeight;
|
2022-02-03 21:56:14 +03:00
|
|
|
|
private readonly string Message;
|
2022-02-02 10:23:50 +03:00
|
|
|
|
|
2022-02-03 21:56:14 +03:00
|
|
|
|
public ProgressBar(string message, int weight)
|
2022-02-02 10:23:50 +03:00
|
|
|
|
{
|
2022-02-03 21:56:14 +03:00
|
|
|
|
Message = message;
|
2022-02-02 10:23:50 +03:00
|
|
|
|
TaskWeight = weight;
|
|
|
|
|
CurrentProgress = 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-02-04 09:17:12 +03:00
|
|
|
|
public override void Update()
|
2022-02-02 10:23:50 +03:00
|
|
|
|
{
|
|
|
|
|
double percent = (++CurrentProgress / TaskWeight) * 100;
|
2022-04-03 12:24:22 +03:00
|
|
|
|
Excel.StatusBar = $"{Message} Выполнено {percent:#.#} %";
|
2022-02-02 10:23:50 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|