public void ExecuteSearch() { var crit = new EventLogQueryCriteria() { ProvidersName = string.IsNullOrWhiteSpace(ProviderName) ? new List <string>() : ProviderName.Split(';').ToList(), DateFrom = DateFrom, DateTo = DateTo, EventLogEntryTypeList = SelectedEntryTypeList, DescriptionContains = string.IsNullOrWhiteSpace(Contains) ? new List <string>() : Contains.Split(';').ToList() }; List <string> serversList = new List <string>(); if (SelectedCategories != null && SelectedCategories.Any()) { serversList.AddRange(SelectedCategories.SelectMany(x => x.ServerList).Select(x => x.Name)); } if (!string.IsNullOrEmpty(ManualServers)) { serversList.AddRange(ManageManualServerList(ManualServers)); } if (serversList.Any()) { var logs = _eventLogReaderManager.ReadLogs(serversList, crit); if (logs != null && logs.Any()) { EventResultList = new ObservableCollection <Event>(logs.Select(x => new Event(x)).ToList()); } else { EventResultList = new ObservableCollection <Event>(); MessageBox.Show("No events found with the current criteria"); } RaisePropertyChanged("EventResultList"); } else { MessageBox.Show("No servers has been selected!"); } }