本文整理汇总了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 );
}
示例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();
}
示例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();
}
示例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 ) );
}