Пример #1
0
        /// <summary>
        /// Finds child nodes uner the parent node and places them in the currentList.
        /// </summary>
        /// <param name="currentList">List to be populated with the nodes.</param>
        /// <param name="parent">Parent node under which the nodes should be searched.</param>
        /// <param name="filter">Filter to be used while selecting the node.</param>
        /// <param name="criteria">Criteria to be used by the filter.</param>
        public static void FindNodes(IList <HierarchyNode> currentList, HierarchyNode parent, WixNodeFilter filter, object criteria)
        {
            if (currentList == null)
            {
                throw new ArgumentNullException("currentList");
            }

            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            if (filter == null)
            {
                throw new ArgumentNullException("filter");
            }

            for (HierarchyNode child = parent.FirstChild; child != null; child = child.NextSibling)
            {
                if (filter(child, criteria))
                {
                    currentList.Add(child);
                }

                WixHelperMethods.FindNodes(currentList, child, filter, criteria);
            }
        }
Пример #2
0
        internal static void RemoveNonMemberItems(WixProjectNode project)
        {
            IList <HierarchyNode> nodeList = new List <HierarchyNode>();

            WixHelperMethods.FindNodes(nodeList, project, WixProjectMembers.IsNodeNonMemberItem, null);
            for (int index = nodeList.Count - 1; index >= 0; index--)
            {
                HierarchyNode parent = nodeList[index].Parent;
                nodeList[index].OnItemDeleted();
                parent.RemoveChild(nodeList[index]);
            }
        }