public dmCollection()
     : base(null)
 {
     Disabled         = new dmGroup(this);
     Disabled.Name    = "Disabled";
     Disabled.Comment = "Disabled Groups and Rulesets";
 }
示例#2
0
        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 dmCollection(dmGroup rsGroup)
     : this()
 {
     this.Groups.Add(rsGroup.Clone(this));
 }
示例#4
0
 public int IndexOfGroup(dmGroup item)
 {
     return(Groups.IndexOf(item));
 }
示例#5
0
 public bool ContainsGroup(dmGroup item)
 {
     return(Groups.Contains(item));
 }
示例#6
0
 public void InsertGroup(int index, dmGroup item)
 {
     Groups.Insert(index, item);
 }
示例#7
0
 public bool RemoveGroup(dmGroup item)
 {
     return(Groups.Remove(item));
 }
示例#8
0
 public bool Contains(dmGroup item)
 {
     return(ContainsGroup(item));
 }
示例#9
0
 public void AddGroup(dmGroup rsgGroup)
 {
     this.Groups.Add(rsgGroup);
 }