diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-05 00:35:57 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-05-05 00:35:57 +0300 |
| commit | dd81a94133e1c5117e06e84cbddf45ffec30acfc (patch) | |
| tree | 13640f05cae1caf4d893d94e73bb0b7a2705110a /Software/Visual_Studio/Tango.Core | |
| parent | a64398732031132ddedd6584c1990a5caa1ae049 (diff) | |
| download | Tango-dd81a94133e1c5117e06e84cbddf45ffec30acfc.tar.gz Tango-dd81a94133e1c5117e06e84cbddf45ffec30acfc.zip | |
Dashboard completed ?
Remote job tracking.
Diffstat (limited to 'Software/Visual_Studio/Tango.Core')
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/TangoProgress.cs | 23 |
1 files changed, 15 insertions, 8 deletions
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. /// </summary> /// <typeparam name="T"></typeparam> - public class TangoProgress<T> where T : IComparable, IFormattable, IConvertible + public class TangoProgress<T> where T : IComparable, IFormattable { /// <summary> /// 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 /// </summary> /// <typeparam name="T"></typeparam> /// <seealso cref="System.EventArgs" /> - public class TangoProgressChangedEventArgs<T> : EventArgs where T : IComparable, IFormattable, IConvertible + public class TangoProgressChangedEventArgs<T> : EventArgs where T : IComparable, IFormattable { /// <summary> /// Gets or sets the progress. |
