当前位置: 首页>>代码示例>>C#>>正文


C# Tree.RenderList方法代码示例

本文整理汇总了C#中Tree.RenderList方法的典型用法代码示例。如果您正苦于以下问题:C# Tree.RenderList方法的具体用法?C# Tree.RenderList怎么用?C# Tree.RenderList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tree的用法示例。


在下文中一共展示了Tree.RenderList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: testTreeHtml

        public void testTreeHtml()
        {
            List<Node> nodes = getNodesAll();
            Tree<Node> tree = new Tree<Node>( nodes );

            string html = @"<ul class=""wTree"" id=""myTree""><li class=""parentNode expandNode"">node1</li><ul class=""hide""><li>node4</li><li class=""parentNode expandNode"">node5</li><ul class=""hide""><li>node13</li><li>node14</li><li>node15</li></ul><li>node6</li></ul><li class=""parentNode expandNode"">node2</li><ul class=""hide""><li>node7</li><li>node8</li><li>node9</li></ul><li class=""parentNode expandNode"">node3</li><ul class=""hide""><li>node10</li><li>node11</li><li>node12</li></ul></ul>";
            string rthml = tree.RenderList( "myTree", false, null, 0 );

            Assert.AreEqual( html, rthml );

            Console.WriteLine( rthml );
        }
开发者ID:bae2014,项目名称:wojilu,代码行数:12,代码来源:TreeTest.cs

示例2: bindSidebar

        private void bindSidebar( Page data )
        {
            List<Page> relativeList = pageService.GetPosts( ctx.owner.obj, data.Category.Id );

            IBlock sidebar = getBlock( "sidebar" );
            if (relativeList.Count <= 1) return;

            sidebar.Set( "category.Name", data.Category.Name );

            Tree<Page> tree = new Tree<Page>( relativeList );

            CurrentRequest.setItem( "__currentPageParentId", data.ParentId );

            treeBinder binder = new treeBinder();
            binder.link = this.ctx.link;

            sidebar.Set( "tree", tree.RenderList( "mytree", true, binder, data.Id ) );

            String cmd = hasPermission( data.Category ) ? string.Format( "<a href=\"{0}\" class=\"btn\"><i class=\"icon-plus\"></i> 添加页面</a>", to( Add, data.Category.Id ) ) : "";

            sidebar.Set( "addCmd", cmd );

            sidebar.Next();
        }
开发者ID:naroate,项目名称:wojilu,代码行数:24,代码来源:PageController.cs

示例3: bindSidebar

        private void bindSidebar( Page data )
        {
            List<Page> relativeList = pageService.GetPosts( ctx.owner.obj, data.Category.Id );

            IBlock sidebar = getBlock( "sidebar" );
            if (relativeList.Count <= 1) return;

            sidebar.Set( "category.Name", data.Category.Name );

            Tree<Page> tree = new Tree<Page>( relativeList );

            treeBinder binder = new treeBinder();
            binder.link = this.ctx.link;

            sidebar.Set( "tree", tree.RenderList( "mytree", true, binder, data.Id ) );

            String cmd = hasPermission( data.Category ) ? string.Format( "<img src=\"{1}\" /> <a href=\"{0}\">���ҳ��</a>", to( Add, data.Category.Id ), strUtil.Join( sys.Path.Img, "add.gif" ) ) : "";

            sidebar.Set( "addCmd", cmd );

            sidebar.Next();
        }
开发者ID:Boshin,项目名称:wojilu,代码行数:22,代码来源:PageController.cs

示例4: SideBar

        public virtual void SideBar()
        {
            Page data = ctx.GetItem( "_currentPage" ) as Page;
            List<Page> relativeList = ctx.GetItem( "_relativeList" ) as List<Page>;

            // 1) 所属分类
            set( "category.Name", data.Category.Name );

            // 2) 添加命令
            String cmd = hasPermission( data.Category ) ? string.Format( "<a href=\"{0}\" class=\"btn\"><i class=\"icon-plus\"></i> 添加页面</a>", to( Add, data.Category.Id ) ) : "";
            set( "addCmd", cmd );

            // 3) 树形列表
            Tree<Page> tree = new Tree<Page>( relativeList );
            CurrentRequest.setItem( "__currentPageParentId", data.ParentId );
            treeBinder binder = new treeBinder( data.Id );
            binder.link = this.ctx.link;
            List<zNode> nodes = tree.GetZNodeList( binder );
            set( "jsonData", Json.ToString( nodes ) );

            // 4) 传统链接
            set( "tree", tree.RenderList( "mytree", true, binder, data.Id ) );

            // 5) 当前菜单的url
            Page homePage = relativeList.Count == 0 ? data : tree.GetAllOrdered()[0];
            ctx.SetItem( "_moduleUrl", to( Show, homePage.Id ) );
        }
开发者ID:neo2018,项目名称:wojilu,代码行数:27,代码来源:PageController.cs


注:本文中的Tree.RenderList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。