From dd81a94133e1c5117e06e84cbddf45ffec30acfc Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 5 May 2020 00:35:57 +0300 Subject: Dashboard completed ? Remote job tracking. --- Software/Visual_Studio/Tango.Core/TangoProgress.cs | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'Software/Visual_Studio/Tango.Core') diff --git a/Software/Visual_Studio/Tango.Core/TangoProgress.cs b/Software/Visual_Studio/Tango.Core/TangoProgress.cs index be684ece9..ccec0e546 100644 --- a/Software/Visual_Studio/Tango.Core/TangoProgress.cs +++ b/Software/Visual_Studio/Tango.Core/TangoProgress.cs @@ -10,7 +10,7 @@ namespace Tango.Core /// Represents a progress of some process. /// /// - public class TangoProgress where T : IComparable, IFormattable, IConvertible + public class TangoProgress where T : IComparable, IFormattable { /// /// Gets or sets the progress message. @@ -39,14 +39,21 @@ namespace Tango.Core { get { - double max = Convert.ToDouble(Maximum); - double value = Convert.ToDouble(Value); - - if (max > 0) + try { - return Math.Round(value / max * 100d, 0); + double max = Convert.ToDouble(Maximum); + double value = Convert.ToDouble(Value); + + if (max > 0) + { + return Math.Round(value / max * 100d, 0); + } + else + { + return 0; + } } - else + catch { return 0; } @@ -87,7 +94,7 @@ namespace Tango.Core /// /// /// - public class TangoProgressChangedEventArgs : EventArgs where T : IComparable, IFormattable, IConvertible + public class TangoProgressChangedEventArgs : EventArgs where T : IComparable, IFormattable { /// /// Gets or sets the progress. -- cgit v1.3.1