예제 #1
0
 public Rule GetRule(int pos)
 {
     if (rules.ContainsKey(pos))
     return rules[pos];
     else
     {
     Rule r = new Rule(this, pos);
     rules.Add(pos, r);
     if (this.NextRulePos < pos)
     this.NextRulePos = pos + 1;
     return r;
     }
 }
예제 #2
0
 public void RemoveRule(Rule r)
 {
     if (rules.ContainsKey(r.pos))
     rules.Remove(r.pos);
 }
예제 #3
0
 public Rule AddRule(RuleTypes type, RuleDirections dir, string pattern, string replacement)
 {
     Rule r = new Rule(this, this.NextRulePos, type, dir, pattern, replacement);
     rules.Add(this.NextRulePos, r);
     this.NextRulePos ++;
     return r;
 }