예제 #1
0
        public void ReplaceRule(int index, HandleRule replacement)
        {
            BeforeReplace?.Invoke(this, replacement);
            var removingItem = rulesStorage[index];

            rulesStorage.Insert(index, replacement);
            rulesStorage.Remove(item: removingItem);
        }
예제 #2
0
        public void SetRule(HandleRule rule)
        {
            handleRule = rule;
            NoteOnRule noteOnRule = handleRule as NoteOnRule;

            if (noteOnRule != null)
            {
                editNote.Text = noteOnRule.Note.ToString();
            }
        }
예제 #3
0
 public virtual void CopyHeadInformationFrom(HandleRule source)
 {
     StopProcessing = source.StopProcessing;
     if (source.Action != null)
     {
         var a = (HandleRuleAction)source.Action.Clone();
         Action = a;
     }
     SValues       = source.SValues;
     this.RuleName = source.RuleName;
 }
예제 #4
0
        public void ReplaceRule(HandleRule oldRule, HandleRule newRule)
        {
            BeforeReplace?.Invoke(this, newRule);
            int index = rulesStorage.IndexOf(oldRule);

            if (index < 0)
            {
                index = rulesStorage.Count;
            }
            rulesStorage.Insert(index, newRule);
            rulesStorage.Remove(oldRule);
        }
 public void SetRule(HandleRule rule)
 {
     handleRule             = rule;
     editControlNumber.Text = handleRule.GetValue("ControlNumber").ToString();
 }
예제 #6
0
 public int GetIndexByRule(HandleRule rule)
 {
     return(rulesStorage.IndexOf(rule));
 }
예제 #7
0
 public void RemoveRule(HandleRule rule)
 {
     BeforeDeleteRule?.Invoke(this, rule);
     rulesStorage.Remove(rule);
 }
예제 #8
0
 public void AddRule(HandleRule rule)
 {
     rulesStorage.Add(rule);
     AfterAddRule?.Invoke(this, rule);
 }
예제 #9
0
 public void SetRule(HandleRule rule)
 {
     handleRule = rule;
 }