Exemple #1
0
 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 { }
     }
 }
        private void LoadEditData()
        {
            EventLogNotifierConfig selectedEntry = new EventLogNotifierConfig();

            if (SelectedEntry != null)
            {
                selectedEntry = (EventLogNotifierConfig)SelectedEntry;
            }

            if (selectedEntry != null)
            {
                txtMachine.Text      = selectedEntry.MachineName;
                txtEventLogName.Text = selectedEntry.EventLogName;
                txtEventSource.Text  = selectedEntry.EventSource;
                successEventIDNumericUpDown.Value = selectedEntry.SuccessEventID;
                warningEventIDNumericUpDown.Value = selectedEntry.WarningEventID;
                errorEventIDNumericUpDown.Value   = selectedEntry.ErrorEventID;
            }
            CheckOKEnabled();
        }