Mercurial > servermonitor
diff ServerMonitor/Objects/CheckResult.cs @ 4:3142e52cbe69
Lots more progress
author | Brad Greco <brad@bgreco.net> |
---|---|
date | Sun, 10 Feb 2019 20:51:26 -0500 |
parents | 96f0b028176d |
children | 052aa62cb42a |
line wrap: on
line diff
--- a/ServerMonitor/Objects/CheckResult.cs Fri Jan 11 22:34:18 2019 -0500 +++ b/ServerMonitor/Objects/CheckResult.cs Sun Feb 10 20:51:26 2019 -0500 @@ -18,6 +18,24 @@ public DateTime EndTime { get; set; } + public bool Failed => CheckStatus != CheckStatus.Success; + + public FailAction FailAction + { + get + { + switch (CheckStatus) + { + case CheckStatus.Error: return Settings.Default.ErrorAction; + case CheckStatus.Warning: return Settings.Default.WarningAction; + case CheckStatus.Information: return Settings.Default.InformationAction; + default: return FailAction.None; + } + } + } + + public bool FlashTaskbar => FailAction == FailAction.FlashTaskbar; + public CheckResult(Check check, CheckStatus status, string message) { Check = check;