/// <summary> /// Method to update the header label with a count of active alarms from /// within the last 24 hours. /// </summary> private void UpdateActiveAlarms(object threadable) { var controller = new AlarmController(); while (true) { /* * Updates to the Alarm Count are handled within TRY/CATCH because there is potential * for external changes that may cut/slow the data flow/connection. */ try { //Only counts alarms that have been active for longer than 24 hours. var liveCount = controller.GetAllAlarms(24).Count(a => !a.Accepted); //_activeAlarmCount = controller.GetAllAlarms(24).Count(a => !a.Accepted); _activeAlarmCount = controller.GetActiveAlarmCount(); //Sleep for X seconds System.Threading.Thread.Sleep(1000); } catch (Exception e) { DebugOutput.Print("Alarm Updating Error - ", e.Message); } } }