/// <summary>
 /// Adds the directories to the tree view.
 /// </summary>
 public void AddDirectories(WixDirectoryElement[] directories)
 {
     foreach (WixDirectoryElement directory in directories)
     {
         WixTreeNodeBuilder.AddNode(this, directory);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Adds child nodes to this tree node.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            if (dummyChildNode != null)
            {
                Nodes.Remove(dummyChildNode);
                dummyChildNode = null;
            }

            WixTreeNodeBuilder.AddNodes(this, element.ChildNodes);
        }
        /// <summary>
        /// Adds a new element to the tree.
        /// </summary>
        /// <remarks>If no node is currently selected this element is added as a
        /// root node.</remarks>
        public void AddElement(XmlElement element)
        {
            WixTreeNode selectedNode = (WixTreeNode)SelectedNode;

            if (selectedNode == null)
            {
                WixTreeNodeBuilder.AddNode(this, element);
            }
            else
            {
                if (selectedNode.IsInitialized)
                {
                    WixTreeNodeBuilder.AddNode(selectedNode, element);
                }
                else
                {
                    // Initializing the node will add all the child elements.
                    selectedNode.PerformInitialization();
                }
            }
        }