aboutsummaryrefslogtreecommitdiff
path: root/src/Interface/ProgressBar.cs
diff options
context:
space:
mode:
authorSerghei Cebotari <51533848+schebotar@users.noreply.github.com>2022-02-05 13:18:18 +0300
committerGitHub <noreply@github.com>2022-02-05 13:18:18 +0300
commitad7234fda7927c45e5ca457facae71a4b9be6b31 (patch)
treed9fc89b0e02a5fdc92d54674b7b48ad2d10859e4 /src/Interface/ProgressBar.cs
parent180807d749f4eb3a16c1f136d42b90ea2945008f (diff)
parenteb6a28b955b5b179bd40f21dcf1daa6f9337765f (diff)
Merge pull request #15 from schebotar/dev
Dev
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;
+ }
+ }
+ }
+}