protected void AddNodes(ISitemap sitemap, Sitemap_Node node)
        {
            IEnumerator currentSitemap = sitemap.GetEnumerator();

            while (currentSitemap.MoveNext())
            {
                ISitemap newSitemap = (ISitemap)currentSitemap.Current;
                Sitemap_Node newNode = new Sitemap_Node(newSitemap);
                newNode.NavigateUrl	 = string.Format("{0}?id={1}",Request.Path,newSitemap.ID);
                if(CurrentSitemapInfo != null && CurrentSitemapInfo.ID == newSitemap.ID ) newNode.Selected = true;
                node.ChildNodes.Add(newNode);
                AddNodes(newSitemap, newNode);
            }
        }
Exemple #2
0
    private void BuildTree()
    {
        treeMenu.Nodes.Clear();

        #if(DEBUG) //
        SitemapManager.GetInstance().Dispose();
        #endif

        sitemap				= SitemapManager.GetInstance().SiteInfo;
        Sitemap_Node node	= new Sitemap_Node(sitemap);

        treeMenu.Nodes.Add(node);

        AddNodes(sitemap, node);

        treeMenu.ExpandAll();
    }