RhSolutions-AddIn/RhSolutions.AddIn/Models/ProgressBar.cs
2023-03-22 08:36:13 +03:00

23 lines
611 B
C#

namespace RhSolutions.Models
{
internal class ProgressBar : StatusbarBase
{
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;
Excel.StatusBar = $"{Message} Выполнено {percent:#.#} %";
}
}
}