diff --git a/ATXTray/AutoTxTray.cs b/ATXTray/AutoTxTray.cs index e76356bb18301f80d1a5fce1abe8768bba710e48..fc0aa08e2375c55abd4690e77490eea382f874a4 100644 --- a/ATXTray/AutoTxTray.cs +++ b/ATXTray/AutoTxTray.cs @@ -87,6 +87,7 @@ namespace ATXTray if (_svcRunning) { serviceRunning = "OK"; ReadStatus(); + UpdateSvcSuspended(); if ((DateTime.Now - _status.LastStatusUpdate).TotalSeconds < 60) heartBeat = "OK"; if (_status.TransferInProgress) @@ -155,5 +156,24 @@ namespace ATXTray "Service stopped.", ToolTipIcon.Error); } } + + private void UpdateSvcSuspended() { + if (_svcSuspended == _status.ServiceSuspended) + return; + + _statusChanged = true; + _svcSuspended = _status.ServiceSuspended; + if (_svcSuspended) { + _miSvcSuspended.Text = @"Service suspended, reason: " + _status.LimitReason; + _miSvcSuspended.BackColor = Color.LightYellow; + _notifyIcon.ShowBalloonTip(500, "AutoTx Monitor", + "Service suspended: " + _status.LimitReason, ToolTipIcon.Warning); + } else { + _miSvcSuspended.Text = @"No limits apply, service active."; + _miSvcSuspended.BackColor = Color.LightGreen; + _notifyIcon.ShowBalloonTip(500, "AutoTx Monitor", + "Service resumed, no limits apply.", ToolTipIcon.Info); + } + } } }