aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Integration/Upgrade/FirmwareUpgradeHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Upgrade/FirmwareUpgradeHandler.cs')
-rw-r--r--Software/Visual_Studio/Tango.Integration/Upgrade/FirmwareUpgradeHandler.cs31
1 files changed, 11 insertions, 20 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Upgrade/FirmwareUpgradeHandler.cs b/Software/Visual_Studio/Tango.Integration/Upgrade/FirmwareUpgradeHandler.cs
index dd42693c4..774824b49 100644
--- a/Software/Visual_Studio/Tango.Integration/Upgrade/FirmwareUpgradeHandler.cs
+++ b/Software/Visual_Studio/Tango.Integration/Upgrade/FirmwareUpgradeHandler.cs
@@ -19,8 +19,6 @@ namespace Tango.Integration.Upgrade
internal FirmwareUpgradeHandler()
{
- IsIndeterminate = true;
- Total = 100;
Message = "Initializing...";
}
@@ -43,8 +41,8 @@ namespace Tango.Integration.Upgrade
private set { _status = value; RaisePropertyChangedAuto(); }
}
- private double _current;
- public double Current
+ private long _current;
+ public long Current
{
get { return _current; }
internal set
@@ -53,20 +51,13 @@ namespace Tango.Integration.Upgrade
}
}
- private double _total;
- public double Total
+ private long _total;
+ public long Total
{
get { return _total; }
internal set { _total = value; RaisePropertyChangedAuto(); }
}
- private bool _isIndeterminate;
- public bool IsIndeterminate
- {
- get { return _isIndeterminate; }
- set { _isIndeterminate = value; RaisePropertyChangedAuto(); }
- }
-
public Task Cancel()
{
return Task.Factory.StartNew(() =>
@@ -80,27 +71,28 @@ namespace Tango.Integration.Upgrade
internal void RaiseCompleted()
{
- RaiseProgress(FirmwareUpgradeStatus.Completed, "Firmware upgrade completed.", false, 100, 100);
+ Status = FirmwareUpgradeStatus.Completed;
+ Message = "Completed.";
Completed?.Invoke(this, new EventArgs());
}
internal void RaiseCanceled()
{
- RaiseProgress(FirmwareUpgradeStatus.Canceled, "Firmware upgrade canceled by user.", false, 100, 0);
+ Status = FirmwareUpgradeStatus.Canceled;
+ Message = "Canceled.";
Canceled?.Invoke(this, new EventArgs());
}
internal void RaiseFailed(Exception ex)
{
- RaiseProgress(FirmwareUpgradeStatus.Failed, "Firmware upgrade failed.", false, 100, 0);
+ Status = FirmwareUpgradeStatus.Failed;
+ Message = "Failed.";
Failed?.Invoke(this, ex);
}
- internal void RaiseProgress(FirmwareUpgradeStatus status, String message, bool isIndeterminate = true, double total = 100, double current = 0)
+ internal void RaiseProgress(long current, FirmwareUpgradeStatus status, String message)
{
- Total = total;
Current = current;
- IsIndeterminate = isIndeterminate;
Status = status;
Message = message;
@@ -110,7 +102,6 @@ namespace Tango.Integration.Upgrade
Status = Status,
Total = Total,
Message = Message,
- IsIndeterminate = IsIndeterminate
});
}
}