public void BasicRepopulate(BasicMonitor basicMonitor)
 {
     switch (basicMonitor.BasicMonitorType)
     {
         case BasicMonitorType.Ftp:
             basicMonitorFtpPathTextBox.Text = basicMonitor.Data.UrlUncIp;
             basicMonitorFtpPathPortTextBox.Text = basicMonitor.Data.Port.ToString();
             basicMonitorFtpUseSslCheckBox.Checked = basicMonitor.Credential.UseSecure;
             basicMonitorFtpUserTextBox.Text = basicMonitor.Credential.Username;
             basicMonitorFtpPassTextBox.Text = basicMonitor.Credential.Password;
             basicMonitorFtpGroupBox.BackColor = Color.LightGray;
             basicMonitorFtpMonitorSelect.Checked = true;
             break;
         case BasicMonitorType.Http:
             basicMonitorHttpPathTextBox.Text = basicMonitor.Data.UrlUncIp;
             basicMonitorHttpPathPortTextBox.Text = basicMonitor.Data.Port.ToString();
             basicMonitorHttpGroupBox.BackColor = Color.LightGray;
             basicMonitorHttpMonitorSelect.Checked = true;
             break;
         case BasicMonitorType.Ping:
             basicMonitorIpTextBox.Text = basicMonitor.Data.UrlUncIp;
             basicMonitorPingGroupBox.BackColor = Color.LightGray;
             basicMonitorPingMonitorSelect.Checked = true;
             break;
     }
     _basicType = basicMonitor.BasicMonitorType;
     basicMonitorTestDataUpdateFreqTextBox.Text = basicMonitor.UpdateFrequency.ToString();
 }
 public BasicMonitor GetBasicMonitor()
 {
     BasicMonitor basicMonitor = new BasicMonitor
                                     {
                                         FriendlyName = FriendlyName,
                                         UpdateFrequency =
                                             Convert.ToInt32(
                                                 basicMonitorTestDataUpdateFreqTextBox.Text),
                                         BasicMonitorType = BasicType
                                     };
     switch (BasicType)
     {
         case BasicMonitorType.Ping:
             basicMonitor.Server = basicMonitorIpTextBox.Text;
             basicMonitor.Data.UrlUncIp = basicMonitorIpTextBox.Text;
             break;
         case BasicMonitorType.Http:
             basicMonitor.Server = basicMonitorHttpPathTextBox.Text;
             basicMonitor.Data.UrlUncIp = basicMonitorHttpPathTextBox.Text;
             basicMonitor.Data.Port = (Int32)basicMonitorHttpPathPortTextBox.ValidateText();
             break;
         case BasicMonitorType.Ftp:
             basicMonitor.Server = basicMonitorFtpPathTextBox.Text;
             basicMonitor.Data.UrlUncIp = basicMonitorFtpPathTextBox.Text;
             basicMonitor.Data.Port = (Int32)basicMonitorFtpPathPortTextBox.ValidateText();
             basicMonitor.Credential.Username = basicMonitorFtpUserTextBox.Text;
             basicMonitor.Credential.Password = basicMonitorFtpPassTextBox.Text;
             basicMonitor.Credential.UseSecure = basicMonitorFtpUseSslCheckBox.Checked;
             break;
         case BasicMonitorType.None:
         default:
             break;
     }
     return basicMonitor;
 }
예제 #3
0
        protected BasicMonitor AddBasicMonitor(string monitorName)
        {
            var monitor = new BasicMonitor(CategoryName, monitorName);

            _registeredMonitors.Add(monitor);

            return(monitor);
        }
 protected override void RegisterMonitors()
 {
     NotificationQueueMonitor = AddBasicMonitor(NotificationQueueMonitorName);
 }