comparison ServerMonitor/Objects/Checks/Check.cs @ 8:052aa62cb42a

Single instance. Add autorun option. Add icons. General enhancements.
author Brad Greco <brad@bgreco.net>
date Sat, 09 Mar 2019 20:14:03 -0500
parents 3142e52cbe69
children 7626b099aefd
comparison
equal deleted inserted replaced
7:8486ab7d2357 8:052aa62cb42a
61 61
62 public CheckStatus LastRunStatus { get; set; } 62 public CheckStatus LastRunStatus { get; set; }
63 63
64 public CheckStatus FailStatus { get; set; } 64 public CheckStatus FailStatus { get; set; }
65 65
66 public int MaxConsecutiveFailures { get; set; }
67
68 [XmlIgnore]
69 public int ConsecutiveFailures { get; set; }
70
66 [XmlIgnore] 71 [XmlIgnore]
67 public Server Server { get; set; } 72 public Server Server { get; set; }
68 73
69 public Check() 74 public Check()
70 { 75 {
81 string message = string.Empty; 86 string message = string.Empty;
82 if (Name.IsNullOrEmpty() && saving) 87 if (Name.IsNullOrEmpty() && saving)
83 message += "Name cannot be blank." + Environment.NewLine; 88 message += "Name cannot be blank." + Environment.NewLine;
84 return message; 89 return message;
85 } 90 }
86
87 //public virtual CheckStatus Execute()
88 //{
89 // //TODO
90 // throw new NotImplementedException();
91 //}
92 91
93 public async Task<CheckResult> ExecuteAsync(CancellationToken token = default(CancellationToken), bool update = true) 92 public async Task<CheckResult> ExecuteAsync(CancellationToken token = default(CancellationToken), bool update = true)
94 { 93 {
95 if (token.IsCancellationRequested) 94 if (token.IsCancellationRequested)
96 return null; 95 return null;