public dmGroup(dmContainer dmcParent) : base(dmcParent) { this.FiltersAndDefaults = new dmRuleset(this); this.Rulesets = new SortableBindingList <dmRuleset>(); this.Groups = new SortableBindingList <dmGroup>(); }
protected int ParseGroup(string[] strArray, int nLineStart, dmContainer Parent) { int nReturn = nLineStart; dmGroup newGroup = new dmGroup(this); Dictionary <string, string> itemParameters = GetParameters(strArray[nReturn]); foreach (KeyValuePair <string, string> item in itemParameters) { switch (item.Key) { case "FILTERSANDDEFAULTS": newGroup.FiltersAndDefaults.Parse(item.Value); break; case "GROUP": newGroup.Name = item.Value; break; case "COMMENT": newGroup.Comment = item.Value; break; } } nReturn++; //parses until it reaches the end of the group and returns the line number after the end of the group while (nReturn < strArray.Length && IdentifyLineType(strArray[nReturn]) != LineParseType.GroupEndLine) { string[] tmpVariable = new string[0]; switch (IdentifyLineType(strArray[nReturn])) { case LineParseType.GroupStartLine: nReturn = ParseGroup(strArray, nReturn, newGroup); break; case LineParseType.RulesetLine: case LineParseType.RulesetNameLine: nReturn = ParseRuleset(strArray, nReturn, newGroup); break; default: nReturn++; break; } } nReturn++; Parent.AddGroup(newGroup); return(nReturn); }
public dmRuleset(dmContainer dmcParent, dmRuleset other) : this(dmcParent) { dmRuleset tmp = new dmRuleset(dmcParent); tmp.Name = this.Name; tmp.Comment = this.Comment; foreach (dmRule item in Rules) { tmp.Rules.Add((dmRule)item.Clone()); } foreach (dmAction item in Actions) { tmp.Actions.Add((dmAction)item.Clone()); } this.OriginalText = other.OriginalText; }
public dmRuleset(dmContainer dmcParent, string[] strStrings) : this(dmcParent) { if (strStrings.Length > 1) { string[] NameAndComment = strStrings[0].Split(new string[] { Global.RulesetNameHeader, Global.CommentHeader }, StringSplitOptions.RemoveEmptyEntries); if (NameAndComment.Length > 0) { Name = NameAndComment[0]; } if (NameAndComment.Length > 1) { Comment = NameAndComment[1]; } Parse(strStrings[1]); } else { Parse(strStrings[0]); } }
public int MergeRuleset(string[] strArray, int nLineStart, dmContainer dmcParent) { int nReturn = nLineStart; //parses until it reaches the end of the group and returns the line number after the end of the group dmRuleset newRS = new dmRuleset(this); string tmpString = strArray[nReturn]; LineParseType tmpLPT = IdentifyLineType(tmpString); if (tmpLPT == LineParseType.RulesetNameLine) { Dictionary <string, string> itemParameters = GetParameters(strArray[nReturn]); foreach (KeyValuePair <string, string> item in itemParameters) { switch (item.Key) { case "NAME": newRS.Name = item.Value; break; case "COMMENT": newRS.Comment = item.Value; break; } } nReturn++; } newRS.Parse(strArray[nReturn]); if (!dmcParent.Rulesets.Contains(newRS)) { dmcParent.AddRuleset(newRS); } nReturn++; return(nReturn); }
public dmGroup(dmContainer dmcParent, string[] strArrayGroup) : this(dmcParent) { Parse(strArrayGroup, 0); }
public dmGroup(dmContainer dmcParent, XElement xParameters) : this(dmcParent) { FromXML(xParameters); }
public dmGroup Clone(dmContainer dmcParent) { return(new dmGroup(dmcParent, this.ToXML("group"))); }
public dmRuleset(dmContainer dmcParent, string strRule) : this(dmcParent) { Parse(strRule); }
public dmRuleset(dmContainer dmcParent, string strRule, Version version) : this(dmcParent) { Parse(strRule, version); }
public dmRuleset(dmContainer dmcParent) : base(dmcParent) { }
public dmRuleset Clone(dmContainer dmcParent) { return(new dmRuleset(dmcParent, this.ToXML("ruleset"))); }
public dmRuleset(dmContainer dmcParent, XElement xParameters) : base(dmcParent) { FromXML(xParameters); }
public dmContainer(dmContainer dmcParent) : base(dmcParent) { Clear(); }