示例#1
0
 private void EditSrc()
 {
     if (OneSourceIsSelected())
     {
         int ndx = SourceDefsLV.SelectedIndices[0];
         var frm = new SourceEditFrm(settings.SourceDefs[ndx], false);
         var res = frm.ShowDialog();
         if (res == DialogResult.OK)
         {
             settings.SourceDefs[ndx] = frm.Result;
             SaveSettings();
             PopulateSourceDefs();
         }
     }
 }
示例#2
0
        private void AddSrc()
        {
            int nextID = GenNextSrcID();
            var def    = new SourceDef(nextID, string.Empty, true, new List <ExcludeRule> {
                CommonRules.DefaultAttrRuleForFiles
            }, null);
            var frm = new SourceEditFrm(def, true);

            if (frm.ShowDialog() == DialogResult.OK)
            {
                // Important: Update highest Source ID in settings for future adds
                settings.HighestSourceID = nextID;
                settings.SourceDefs.Add(frm.Result);
                SaveSettings();
                PopulateSourceDefs();
            }
        }