Exemple #1
0
        private void tsbPrevRule_Click(object sender, EventArgs e)
        {
            if ((PresetFile == null) || (rule == null))
            {
                return;
            }
            int index = PresetFile.GetIndexByRule(rule);

            if (index <= 0)
            {
                return;
            }
            Rule = PresetFile.rulesStorage[index - 1];
        }
Exemple #2
0
        private void tsbNextRule_Click(object sender, EventArgs e)
        {
            if ((PresetFile == null) || (rule == null))
            {
                return;
            }
            int index = PresetFile.GetIndexByRule(rule);

            if (index >= PresetFile.rulesStorage.Count - 1)
            {
                return;
            }
            Rule = PresetFile.rulesStorage[index + 1];
        }
Exemple #3
0
 private void tsbSave_Click(object sender, EventArgs e)
 {
     if (EditRule == null)
     {
         return;
     }
     EditRule.RuleName       = editName.Text;
     EditRule.StopProcessing = editStopProcessing.Checked;
     // Change object in storage, if
     if ((Rule != null) && (PresetFile != null))
     {
         PresetFile.ReplaceRule(Rule, EditRule);
         Rule = EditRule;
         int index = PresetFile.GetIndexByRule(Rule);
         OnSaveRule?.Invoke(this, Rule, index);
     }
 }