public void LoadConfig() { try { if (_cfg.AppSettings.Settings.AllKeys.Contains(ConfigConstants.EventLogs) == true) { _eventLogs.Clear(); EventLogs cc = EventLogs.Load(_cfg.AppSettings.Settings[ConfigConstants.EventLogs].Value); if (cc != null) { cc.Logs.ForEach(x => _eventLogs.Add(x)); } } this.eventLogsGrid.ItemsSource = this.Logs; this.eventLogsGrid.SelectedIndex = 0; } catch (System.Exception ex) { Nagios.Net.Client.Log.WriteLog(string.Format("{0}\n{1}", ex.Message, ex.StackTrace), true); } }