public override void ShowChildWindow(IParentWindow parentWindow = null) { //if (ParentWindow != null) // ParentWindow.RegisterChildWindow(this); if (SelectedNotifier != null) { EventLogNotifier thisNotifier = (EventLogNotifier)SelectedNotifier; EventLogNotifierConfig currentConfig = (EventLogNotifierConfig)thisNotifier.AgentConfig; string command = "eventvwr.exe"; try { System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo = new System.Diagnostics.ProcessStartInfo() { FileName = command }; if (currentConfig.MachineName.Length > 1) { p.StartInfo.Arguments = "\\\\" + currentConfig.MachineName; } p.Start(); } catch { } } }
void LoadSettings() { if (Properties.Settings.Default.EnableEmailNotifications && !(String.IsNullOrEmpty(Properties.Settings.Default.EmailSenders) || String.IsNullOrEmpty(Properties.Settings.Default.EmailRecepients) || String.IsNullOrEmpty(Properties.Settings.Default.EmailSmtpServer))) { INotifier notifier = new EmailNotifier(Properties.Settings.Default.EmailSenders, Properties.Settings.Default.EmailRecepients, Properties.Settings.Default.EmailSmtpServer); notifiers.Add(notifier); } if (Properties.Settings.Default.EnableEventLogNotifications) { try { INotifier notifier = new EventLogNotifier(); notifiers.Add(notifier); } catch (SecurityException) { } } if (Properties.Settings.Default.EnableSystemTrayNotifications) { notifiers.Add(trayNotifier); } if (Properties.Settings.Default.HonourFilters) { filters.Add(new ListViewFilter(lstLog)); } if (Properties.Settings.Default.MinimumSeverity > 0) { filters.Add(new SeverityFilter(Properties.Settings.Default.MinimumSeverity)); } }