protected void CreateRootNode()
 {
     m_initNode          = XmlTreeNode.CreateRoot(this);
     m_initNode.Icon     = FolderIcon;
     m_initNode.OpenIcon = FolderIconOpen;
     CreateRootNode(ref m_initNode);
 }
        /// <summary>
        /// A helper method to re-generate the root node for the current tree.
        /// </summary>
        /// <returns></returns>
        public XmlTreeNode GenerateRootNode()
        {
            XmlTreeNode node = XmlTreeNode.CreateRoot(this);

            this.CreateRootNode(ref node);
            return(node);
        }
        protected override void CreateRootNode(ref XmlTreeNode rootNode)
        {
            //if the _rootNode is not defined yet, just return an empty one
            if (_rootNode == null)
            {
                NullTree nullTree = new NullTree(this.app);
                _rootNode = XmlTreeNode.CreateRoot(nullTree);
            }

            rootNode.Menu     = _rootNode.Menu;
            rootNode.Text     = _rootNode.Text;
            rootNode.Action   = _rootNode.Action;
            rootNode.Source   = _rootNode.Source;
            rootNode.Icon     = _rootNode.Icon;
            rootNode.OpenIcon = _rootNode.OpenIcon;
            rootNode.NodeType = _rootNode.NodeType;
            rootNode.NodeID   = _rootNode.NodeID;
        }
        /// <summary>
        /// Converts an ITree into a BaseTree. This is used for Legacy trees that don't inherit from BaseTree already.
        /// </summary>
        /// <param name="tree"></param>
        /// <param name="alias"></param>
        /// <param name="appAlias"></param>
        /// <param name="iconClosed"></param>
        /// <param name="iconOpened"></param>
        /// <param name="action"></param>
        /// <returns></returns>
        public static BaseTree FromITree(ITree tree, string alias, string appAlias, string iconClosed, string iconOpened, string action)
        {
            TreeService treeSvc = new TreeService(null, alias, null, null, TreeDialogModes.none, appAlias);
            //create the generic XmlTreeNode and fill it with the properties from the db
            NullTree    nullTree = new NullTree(appAlias);
            XmlTreeNode node     = XmlTreeNode.CreateRoot(nullTree);

            node.Text     = BaseTree.GetTreeHeader(alias);;
            node.Action   = action;
            node.Source   = treeSvc.GetServiceUrl();
            node.Icon     = iconClosed;
            node.OpenIcon = iconOpened;
            node.NodeType = "init" + alias;
            node.NodeType = alias;
            node.NodeID   = "init";
            node.Menu     = BaseTree.GetDefaultRootNodeActions();

            //convert the tree to a LegacyTree
            LegacyTree bTree = new LegacyTree(tree, appAlias, node);

            return(bTree);
        }