private GroupUpdateRuleCollection AddChildrenOf(GroupUpdateRule rule, bool recursive)
            {
                GroupUpdateRuleCollection uc = new GroupUpdateRuleCollection();

                // Loop through the collection and determine if the current rule is a child of the current rule
                foreach (GroupUpdateRule ur in this.List)
                {
                    if (ur.parentcomputergroup != null && rule.computergroup.Id == ur.parentcomputergroup.Id)
                    {
                        // Found one - add it to the collection.
                        uc.Add(ur);

                        // Are we recursively adding children?
                        if (recursive)
                            // Yes, also add all the children of this child node
                            uc.Add(AddChildrenOf(ur, true));
                    }
                }

                return uc;
            }
 public GroupUpdateRuleCollection ChildGroups(GroupUpdateRule rule, bool recursive)
 {
     return AddChildrenOf(rule, recursive);
 }
            public int AddEdit(GroupUpdateRule add)
            {
                // Loop through collection to see if we can match an existing rule
                for (int i = 0; i < this.List.Count; i++)
                {
                    GroupUpdateRule ur = (GroupUpdateRule) this.List[i];

                    if (ur.computergroup.Id == add.computergroup.Id)
                    {
                        // Found a matching group - update it and exit
                        this.List[i] = add;
                        return i;
                    }
                }

                // We didn't find one, so add it.
                return this.List.Add(add);
            }
 public GroupUpdateRuleCollection ChildGroups(GroupUpdateRule rule)
 {
     // Default is not to recurse if no parameter is provided
     return ChildGroups(rule, false);
 }
 public int Add(GroupUpdateRule add)
 {
     return this.List.Add(add);
 }