private void btnEdit_Click(object sender, EventArgs e) { TriggerNode node = (TriggerNode)jobGroupsTreeView.SelectedNode; AddJobForm form = new AddJobForm(node); form.ShowDialog(); if (form.JobDetail != null && form.Trigger != null) { _schedulerProvider.Scheduler.RescheduleJob(node.Trigger.Key, form.Trigger); loadJobGroups(); } }
//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; // } // catch (SocketException ex) // { // } // } // form.Close(); // } //} private void addJobToolStripMenuItem_Click(object sender, EventArgs e) { AddJobForm jobForm = new AddJobForm(); jobForm.ShowDialog(); if (jobForm.JobDetail != null && jobForm.Trigger != null) { _schedulerProvider.Scheduler.ScheduleJob(jobForm.JobDetail, jobForm.Trigger); loadJobGroups(); loadRunningJobs(); } }