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


C# Tree.GetAllOrdered方法代码示例

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


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

示例1: bindPages

        private void bindPages( List<Page> list )
        {
            Tree<Page> tree = new Tree<Page>( list );

            IBlock block = getBlock( "list" );
            foreach (Page data in tree.GetAllOrdered()) {

                block.Set( "data.Id", data.Id );
                block.Set( "data.OrderId", data.OrderId );

                block.Set( "data.AddSubLink", to( AddSubPage, data.Id ) );

                int indentLength = tree.GetDepth( data.Id ) * 20;
                String indent = "padding-left:" + indentLength + "px";
                block.Set( "data.Indent", indent );

                block.Set( "data.Title", data.Title );
                block.Set( "data.Created", data.Created );
                block.Set( "data.Hits", data.Hits );
                block.Set( "data.ReplyCount", data.Replies );
                block.Set( "data.IsAllowReplyStr", data.IsAllowReplyStr );

                block.Set( "data.ViewUrl", to( ViewUrl, data.Id ) );

                block.Set( "data.LinkShow", plink( data.Id ) );
                block.Set( "data.LinkDelete", to( Delete, data.Id ) );
                block.Set( "data.LinkEdit", to( Edit, data.Id ) );

                block.Next();

            }
        }
开发者ID:LeoLcy,项目名称:cnblogsbywojilu,代码行数:32,代码来源:PageController.cs

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