private void btnNew_Click(object sender, EventArgs e) { var frmJob = new JobEditor((Config)Analyser.Config.Clone()); var result = frmJob.ShowDialog(this); if (result == DialogResult.OK) { //recordJob(frmJob); } updateJobList(); }
private void btnEdit_Click(object sender, EventArgs e) { if (lstJob.SelectedIndex == -1) { return; } var jobName = lstJob.SelectedItem.ToString(); var config = Config.Load(Config.DefaultJobPath + "\\" + jobName + ".conf"); var frmJob = new JobEditor(config); frmJob.btnOk.Text = Resources.Languages.Resources.Txt_Modifier; //get task information var task = GetTask(jobName); if (task == null) { return; } frmJob.Job.Id = new Guid(jobName); frmJob.setTitle(); var triggerType = SchedulerTrigger.getFromTrigger(task.Definition.Triggers[0]); if (triggerType == SchedulerTrigger.TriggerTypes.OneTime) { frmJob.chkOneTime.Checked = true; frmJob.dtpOneTime.Value = task.Definition.Triggers[0].StartBoundary; } else { frmJob.dtpHour.Value = task.Definition.Triggers[0].StartBoundary; frmJob.cmbFrequency.SelectedIndex = (int)triggerType; } if (frmJob.ShowDialog(this) == DialogResult.OK) { //recordJob(frmJob); } }