温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilder v1.1源代码
当前文件:
SpaceBuider11/BasicWebControls/Channel/AreaRepeater.cs,打开代码结构图
SpaceBuider11/BasicWebControls/Channel/AreaRepeater.cs,打开代码结构图1//------------------------------------------------------------------------------ 2
// <copyright company="Tunynet"> 3
// Copyright (c) Tunynet Inc. All rights reserved. 4
// </copyright> 5
//------------------------------------------------------------------------------ 6
7
using System; 8
using System.Collections.Generic; 9
using System.Text; 10
using System.Web.UI.WebControls; 11
using System.Collections; 12
using SpaceBuilder.Components; 13
using System.Web.UI; 14
using SpaceBuilder.Events.Components; 15
using SpaceBuilder.Utils; 16
using TunyNet.Utils; 17
18
namespace SpaceBuilder.Web.Controls 19
{ 20
/// <summary> 21
/// 显示地区列表 22
/// </summary> 23
public class AreaRepeater : Repeater 24
{ 25
private List<AreaStatistics> areas; 26
private int loadedAreaCount = 0; // 已经加载的区域数目 27
28
public void Bind() 29
{ 30
this.ItemDataBound += new RepeaterItemEventHandler(AreaRepeater_ItemDataBound); 31
32
areas = Areas.GetAreaStatisticss(this.ParentAreaID, this.SortBy, this.SortOrder, this.OnlyShowDepth); 33
34
if ((this.DisplayItemCount != -1) && (areas.Count > this.DisplayItemCount)) 35
areas = areas.GetRange(0, this.DisplayItemCount); 36
37
if (areas.Count > 0) 38
{ 39
this.DataSource = this.areas; 40
this.DataBind(); 41
} 42
else 43
{ 44
this.DataSource = null; 45
this.DataBind(); 46
} 47
} 48
49
protected override void Render(HtmlTextWriter writer) 50
{ 51
this.Bind(); 52
if (this.areas.Count > 0) 53
{ 54
base.Render(writer); 55
} 56
} 57
58
事件 136
137
138
属性 242
243
} 244
245
} 246





}