/// <summary>
 /// Adds the directories to the tree view.
 /// </summary>
 public void AddDirectories(WixDirectoryElement[] directories)
 {
     foreach (WixDirectoryElement directory in directories)
     {
         WixTreeNodeBuilder.AddNode(this, directory);
     }
 }
        /// <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();
                }
            }
        }