aboutsummaryrefslogtreecommitdiff
path: root/src/Interface/ProgressBar.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Interface/ProgressBar.cs')
-rw-r--r--src/Interface/ProgressBar.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Interface/ProgressBar.cs b/src/Interface/ProgressBar.cs
new file mode 100644
index 0000000..2e68e8b
--- /dev/null
+++ b/src/Interface/ProgressBar.cs
@@ -0,0 +1,31 @@
+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.ToString("#.#")} %";
+ }
+
+ else
+ {
+ Excel.StatusBar = false;
+ }
+ }
+ }
+}