Exemple #1
0
 public dmGroup(dmContainer dmcParent)
     : base(dmcParent)
 {
     this.FiltersAndDefaults = new dmRuleset(this);
     this.Rulesets           = new SortableBindingList <dmRuleset>();
     this.Groups             = new SortableBindingList <dmGroup>();
 }
        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);
        }
Exemple #3
0
 public override void Clear()
 {
     base.Clear();
     this.FiltersAndDefaults = new dmRuleset(this);
 }
Exemple #4
0
 public override void FromXML(XElement xParameters)
 {
     base.FromXML(xParameters);
     this.FiltersAndDefaults = new dmRuleset(this, xParameters.Element("filtersanddefaults"));
 }
 public void AddRuleset(dmRuleset rsRuleset)
 {
     Rulesets.Add(rsRuleset);
 }
 public int IndexOfRuleset(dmRuleset item)
 {
     return(Rulesets.IndexOf(item));
 }
 public void InsertRuleset(int index, dmRuleset item)
 {
     Rulesets.Insert(index, item);
 }
 public bool RemoveRuleset(dmRuleset item)
 {
     return(Rulesets.Remove(item));
 }
 public bool ContainsRuleset(dmRuleset item)
 {
     return(Rulesets.Contains(item));
 }