23 lines
611 B
C#
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:#.#} %";
|
|
}
|
|
}
|
|
}
|