📄 aggregategrouplist.cs
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
// Copyright (c) Telligent Systems Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;
using System.Web.UI.WebControls;
using CommunityServer.Blogs.Components;
using CommunityServer.Components;
using CommunityServer.Controls;
namespace CommunityServer.Blogs.Controls
{
/// <summary>
/// Summary description for AggregateGroupList.
/// </summary>
public class AggregateGroupList : WeblogBaseTemplatedWebControl
{
public AggregateGroupList()
{
//
// TODO: Add constructor logic here
//
}
ResourceControl Title = null;
Repeater AggList = null;
/// <summary>
/// Property ResourceNameTitle (string)
/// </summary>
public string ResourceNameTitle
{
get
{
return ViewState["ResourceNameTitle"] as string;
}
set
{ ViewState["ResourceNameTitle"] = value; }
}
/// <summary>
/// Property UrlFormat (string)
/// </summary>
public string UrlFormat
{
get{ return ViewState["UrlFormat"] as string;}
set{ ViewState["UrlFormat"] = value; }
}
public override void DataBind()
{
base.DataBind ();
if(DataSource != null)
{
AggList.DataSource = DataSource;
AggList.DataBind();
}
this.Title.ResourceName = ResourceNameTitle;
}
private object _dataSource;
/// <summary>
/// Property DataSource (object)
/// </summary>
public object DataSource
{
get { return this._dataSource; }
set { this._dataSource = value; }
}
protected override void AttachChildControls()
{
Title = FindControl("Title") as ResourceControl;
AggList = FindControl("AggList") as Repeater;
AggList.ItemDataBound +=new RepeaterItemEventHandler(AggList_ItemDataBound);
}
private void AggList_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Group g = e.Item.DataItem as Group;
if(g != null)
{
HyperLink aggLink = e.Item.FindControl("AggLink") as HyperLink;
if(aggLink !=null)
{
aggLink.Text = g.Name;
aggLink.NavigateUrl = Globals.GetSiteUrls().UrlData.FormatUrl(UrlFormat,g.GroupID);
}
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -