예제 #1
0
        private void toolStripButton_job_add_Click(object sender, EventArgs e)
        {
            try
            {
                Application.Job newJob = new Application.Job();
                newJob.Enabled   = true;
                newJob.ZPosition = Application.Job.WindowZPosition.NoTopMost;
                newJob.NoSize    = false;
                newJob.NoMove    = false;
                newJob.NoZOrder  = true;

                Forms.editJob ejd = new Forms.editJob(Properties.Strings.editJob_title_new, newJob);

                if (ejd.ShowDialog(this) == DialogResult.OK)
                {
                    this.jobsFile.Add(ejd.GetJob());
                    this.refreshJobsDisplay();
                }
            }
            catch (Exception ex) { Forms.MessageBox.Error(ex.Message); }
        }
예제 #2
0
        private void toolStripButton_job_edit_Click(object sender, EventArgs e)
        {
            if (this.listBox_jobs.SelectedIndex < 0)
            {
                return;
            }

            try
            {
                int id  = this.getSelectedJobId();
                var job = this.jobsFile.Get(id);

                Forms.editJob ejd = new Forms.editJob(Properties.Strings.editJob_title_edit + " [" + job.ID + "] " + job.ProcessName, job);

                if (ejd.ShowDialog(this) == DialogResult.OK)
                {
                    this.jobsFile.Set(id, ejd.GetJob());
                    this.refreshJobsDisplay();
                }
            }
            catch (Exception ex) { Forms.MessageBox.Error(ex.Message); }
        }