温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilder v1.1源代码
当前文件:
SpaceBuider11/BasicWebControls/Channel/SiteLink.cs,打开代码结构图
SpaceBuider11/BasicWebControls/Channel/SiteLink.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.ComponentModel; 10
using System.Drawing; 11
using System.Data; 12
using System.Text; 13
using System.Web.UI.WebControls; 14
using SpaceBuilder.Components; 15
using TunyNet.Data.Utils; 16
using SpaceBuilder.Configuration; 17
using SpaceBuilder.Controls.BaseClasses; 18
using System.Web.UI.HtmlControls; 19
20
namespace SpaceBuilder.Web.Controls 21
{ 22
/// <summary> 23
/// 友情链接 24
/// </summary> 25
public class SiteLink : TemplatedWebControl 26
{ 27
SBContext wlContext; 28
29
属性 71
72
protected override void OnInit(EventArgs e) 73
{ 74
if (SkinName == null) 75
ExternalSkinFileName = "Skin-SiteLink.ascx"; 76
else 77
ExternalSkinFileName = SkinName; 78
79
wlContext = SBContext.Current; 80
base.OnInit(e); 81
} 82
83
/// <summary> 84
/// 友情链接Repeater 85
/// </summary> 86
SiteLinkRepeater siteLinkRepeater = null; 87
88
HtmlGenericControl commonLinkDiv = null; 89
90
/// <summary> 91
/// 获取子控件 92
/// </summary> 93
protected override void AttachChildControls() 94
{ 95
siteLinkRepeater = this.FindControl("SiteLinkRepeater") as SiteLinkRepeater; 96
commonLinkDiv= this.FindControl("commonLink") as HtmlGenericControl; 97
98
if (siteLinkRepeater != null) 99
{ 100
siteLinkRepeater.DisplayItemCount = this.displayItemCount; 101
siteLinkRepeater.LinkCategory = this.linkCategory; 102
siteLinkRepeater.LinkType = this.linkType; 103
siteLinkRepeater.RepeatDirection = this.repeateDirection; 104
105
if (siteLinkRepeater.Items.Count == 0&& commonLinkDiv!=null) 106
{ 107
this.commonLinkDiv.Visible = false; 108
} 109
} 110
} 111
} 112
} 113





}