Esempio n. 1
0
 private void connectToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (ServerConnectForm form = new ServerConnectForm())
     {
         form.ShowDialog();
         if (!form.Cancelled)
         {
             try
             {
                 QuartzScheduler scheduler = new QuartzScheduler(form.Server, form.Port, form.Scheduler);
                 serverConnectStatusLabel.Text = string.Format("Connected to {0}", scheduler.Address);
                 jobsToolStripMenuItem.Enabled = true;
                 loadJobGroups(scheduler);
                 updateRunningJobs();
             }
             catch (SocketException ex)
             {
                 ErrorDialog dialog = new ErrorDialog();
                 dialog.Message     = string.Format("Unable to connect to scheduler {0} on {1}:{2}", form.Scheduler, form.Server, form.Port);
                 dialog.Description = ex.Message;
                 dialog.ShowDialog();
             }
         }
         form.Close();
     }
 }
Esempio n. 2
0
 private void connectToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (ServerConnectForm form = new ServerConnectForm())
     {
         form.ShowDialog();
         if (!form.Cancelled)
         {
             try
             {
                 QuartzScheduler scheduler = new QuartzScheduler(form.Server, form.Port, form.Scheduler);
                 serverConnectStatusLabel.Text = string.Format("Connected to {0}", scheduler.Address);
                 jobsToolStripMenuItem.Enabled = true;
                 loadJobGroups(scheduler);
                 updateRunningJobs();
             }
             catch (SocketException ex)
             {
                 ErrorDialog dialog = new ErrorDialog();
                 dialog.Message = string.Format("Unable to connect to scheduler {0} on {1}:{2}", form.Scheduler, form.Server, form.Port);
                 dialog.Description = ex.Message;
                 dialog.ShowDialog();
             }
         }
         form.Close();
     }
 }