private void StopMonitoring() { timer18.Dispose(); timer19.Dispose(); var controls1 = WrapPanel1.ChildrenOfType <MonitoringAIO>(); var controls2 = WrapPanel2.ChildrenOfType <MonitoringAIO>(); var controls3 = WrapPanel3.ChildrenOfType <MonitoringAIO>(); var controls4 = WrapPanel4.ChildrenOfType <MonitoringAIO>(); var controls5 = WrapPanel5.ChildrenOfType <MonitoringAIO>(); var controls6 = WrapPanel6.ChildrenOfType <MonitoringAIO>(); var controls7 = WrapPanel7.ChildrenOfType <MonitoringAIO>(); var controls8 = WrapPanel8.ChildrenOfType <MonitoringAIO>(); var controls9 = WrapPanel9.ChildrenOfType <MonitoringAIO>(); foreach (var monitoringAio in controls1) { monitoringAio.StopMonitoring(); } foreach (var monitoringAio in controls1) { monitoringAio.StopMonitoring(); } foreach (var monitoringAio in controls2) { monitoringAio.StopMonitoring(); } foreach (var monitoringAio in controls3) { monitoringAio.StopMonitoring(); } foreach (var monitoringAio in controls4) { monitoringAio.StopMonitoring(); } foreach (var monitoringAio in controls5) { monitoringAio.StopMonitoring(); } foreach (var monitoringAio in controls6) { monitoringAio.StopMonitoring(); } foreach (var monitoringAio in controls7) { monitoringAio.StopMonitoring(); } foreach (var monitoringAio in controls8) { monitoringAio.StopMonitoring(); } foreach (var monitoringAio in controls9) { monitoringAio.StopMonitoring(); } RunningStatus = false; }
private void Window_Loaded(object sender, RoutedEventArgs e) { logger = LogManager.GetCurrentClassLogger(); InitializeChannel(); var controls1 = WrapPanel1.ChildrenOfType <MonitoringAIO>(); var controls2 = WrapPanel2.ChildrenOfType <MonitoringAIO>(); var controls3 = WrapPanel3.ChildrenOfType <MonitoringAIO>(); var controls4 = WrapPanel4.ChildrenOfType <MonitoringAIO>(); var controls5 = WrapPanel5.ChildrenOfType <MonitoringAIO>(); var controls6 = WrapPanel6.ChildrenOfType <MonitoringAIO>(); var controls7 = WrapPanel7.ChildrenOfType <MonitoringAIO>(); var controls8 = WrapPanel8.ChildrenOfType <MonitoringAIO>(); var controls9 = WrapPanel9.ChildrenOfType <MonitoringAIO>(); foreach (var monitoringAio in controls1) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } foreach (var monitoringAio in controls1) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } foreach (var monitoringAio in controls2) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } foreach (var monitoringAio in controls3) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } foreach (var monitoringAio in controls4) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } foreach (var monitoringAio in controls5) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } foreach (var monitoringAio in controls6) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } foreach (var monitoringAio in controls7) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } foreach (var monitoringAio in controls8) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } foreach (var monitoringAio in controls9) { monitoringAio.SelectionChanged += monitoringAio_SelectionChanged; } this.RunningStatusChanged += new EventHandler(MainWindow_RunningStatusChanged); #if DEBUG foreach (var monitoringAio in controls) { if (monitoringAio.IPAddress == "192.168.17.18") { monitoringAio.IPAddress = "localhost/monitoring/17.18"; } else if (monitoringAio.IPAddress == "192.168.17.19") { monitoringAio.IPAddress = "localhost/monitoring/17.19"; } } #endif //StartMonitoring(); CheckUpdateAsync checkUpdateAsync = new CheckUpdateAsync(); checkUpdateAsync.CheckUpdateCompleted += new CheckUpdateCompletedEventHandler(checkUpdateAsync_CheckUpdateCompleted); //checkUpdateAsync.StartAsync(); }
private void StartMonitoring() { timer18 = new Timer(GetStatus18, "MHDR", 0, 5000); timer19 = new Timer(GetStatus19, "MHDR", 1, 5000); var controls1 = WrapPanel1.ChildrenOfType <MonitoringAIO>(); var controls2 = WrapPanel2.ChildrenOfType <MonitoringAIO>(); var controls3 = WrapPanel3.ChildrenOfType <MonitoringAIO>(); var controls4 = WrapPanel4.ChildrenOfType <MonitoringAIO>(); var controls5 = WrapPanel5.ChildrenOfType <MonitoringAIO>(); var controls6 = WrapPanel6.ChildrenOfType <MonitoringAIO>(); var controls7 = WrapPanel7.ChildrenOfType <MonitoringAIO>(); var controls8 = WrapPanel8.ChildrenOfType <MonitoringAIO>(); var controls9 = WrapPanel9.ChildrenOfType <MonitoringAIO>(); foreach (var monitoringAio in controls1) { monitoringAio.StartMonitoring(); } foreach (var monitoringAio in controls1) { monitoringAio.StartMonitoring(); } foreach (var monitoringAio in controls2) { monitoringAio.StartMonitoring(); } foreach (var monitoringAio in controls3) { monitoringAio.StartMonitoring(); } foreach (var monitoringAio in controls4) { monitoringAio.StartMonitoring(); } foreach (var monitoringAio in controls5) { monitoringAio.StartMonitoring(); } foreach (var monitoringAio in controls6) { monitoringAio.StartMonitoring(); } foreach (var monitoringAio in controls7) { monitoringAio.StartMonitoring(); } foreach (var monitoringAio in controls8) { monitoringAio.StartMonitoring(); } foreach (var monitoringAio in controls9) { monitoringAio.StartMonitoring(); } RunningStatus = true; }