예제 #1
0
 private void EditJob()
 {
     if (OneJobIsSelected())
     {
         int ndx = JobsLV.SelectedIndices[0];
         var frm = new JobEditFrm(settings.Jobs[ndx], false, 0, settings.SourceDefs.AsReadOnly());
         var res = frm.ShowDialog();
         if (res == DialogResult.OK)
         {
             settings.Jobs[ndx] = frm.Result;
             SaveSettings();
             PopulateJobs();
         }
     }
 }
예제 #2
0
        private void AddJob()
        {
            if (settings.SourceDefs.Count == 0)
            {
                ShowErrMsg("You must define one or more backup sources before configuring a backup job.");
                return;
            }
            int nextID = GenNextJobID();
            var frm    = new JobEditFrm(null, true, nextID, settings.SourceDefs.AsReadOnly());

            if (frm.ShowDialog() == DialogResult.OK)
            {
                // Important: Update highest Job ID in settings for future adds
                settings.HighestJobID = nextID; // update ID tracker
                settings.Jobs.Add(frm.Result);
                SaveSettings();
                PopulateJobs();
            }
        }