您目前尚未登陆,请选择【登陆】或【注册
首页->博客论坛->SpaceBuilder v1.1源代码>>BlogControls/Club/BlogThreadListForClub.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilder v1.1源代码
当前文件:文件类型 SpaceBuider11/BlogControls/Club/BlogThreadListForClub.cs打开代码结构图
普通视图
		            
1//------------------------------------------------------------------------------ 2// <copyright company="Tunynet"> 3// Copyright (c) Tunynet Inc. All rights reserved. 4// </copyright> 5//------------------------------------------------------------------------------ 6 7using System; 8using System.Collections.Generic; 9using System.Text; 10using SpaceBuilder.Components; 11using System.Web.UI.WebControls; 12using System.Collections; 13using SpaceBuilder.Clubs.Components; 14using SpaceBuilder.Utils; 15using System.Web.UI.HtmlControls; 16using SpaceBuilder.Controls.Utils; 17using SpaceBuilder.Blogs.Components; 18using SpaceBuilder.Controls; 19using SpaceBuilder.Clubs.Controls; 20using TunyNet.Data.Utils; 21using TunyNet.Utils; 22using SpaceBuilder.Posts.Components; 23 24namespace SpaceBuilder.Blogs.Controls 25{ 26 /// <summary> 27 /// 显示圈子博客文章列表 28 /// </summary> 29 public class BlogThreadListForClub : ClubDomainThemedControl 30 { 31 private SBContext wlContext = null; 32 33 OnInit 57 58 Child Controls 85 86 protected override void AttachChildControls() 87 { 88 HyClubBlogListForTab = this.FindControl("HyClubBlogListForTab") as HtmlAnchor; 89 HyClubBlogSummaryForTab = this.FindControl("HyClubBlogSummaryForTab") as HtmlAnchor; 90 91 92 if (this.HyClubBlogSummaryForTab != null) 93 { 94 HyClubBlogSummaryForTab.HRef = ClubUrls.Instance().BlogHome(CurrentClubDomainName); 95 if (HyClubBlogSummaryForTab.HRef.Contains("?") == true) 96 { 97 HyClubBlogSummaryForTab.HRef += "&mode=s"; 98 } 99 else 100 { 101 HyClubBlogSummaryForTab.HRef += "?mode=s"; 102 } 103 } 104 if (this.HyClubBlogListForTab != null) 105 { 106 HyClubBlogListForTab.HRef = ClubUrls.Instance().BlogHome(CurrentClubDomainName); 107 108 if (HyClubBlogListForTab.HRef.Contains("?") == true) 109 { 110 HyClubBlogListForTab.HRef += "&mode=l"; 111 } 112 else 113 { 114 HyClubBlogListForTab.HRef += "?mode=l"; 115 } 116 } 117 118 //if (this.HyClubBlogSummaryForTab != null) 119 //{ 120 // HyClubBlogSummaryForTab.HRef = ChannelUrls.Instance().ClubBlogSummaryForTab(CurrentClub.DomainName, 10, (int)SortThreadsBy.LastRepliedDate, (int)SortOrder.Descending); 121 //} 122 123 //if (this.HyClubBlogListForTab != null) 124 //{ 125 // HyClubBlogListForTab.HRef = ChannelUrls.Instance().ClubBlogListForTab(CurrentClub.DomainName, 20, (int)SortThreadsBy.LastRepliedDate, (int)SortOrder.Descending); 126 //} 127 128 //breadCrumb = FindControl("BreadCrumb") as Literal; 129 130 repeaterS = FindControl("repeaterS") as CommendedBlogThreadListRepeater; 131 repeaterL = FindControl("repeaterL") as CommendedBlogThreadListRepeater; 132 pager = FindControl("pager") as PostBackPager; 133 pager.PageIndexChanged += new PagerEventHandler(pager_PageIndexChanged); 134 135 HtmlGenericControl blogDisplayAreaL = this.FindControl("blogDisplayAreaL") as HtmlGenericControl; 136 HtmlGenericControl blogDisplayAreaS = this.FindControl("blogDisplayAreaS") as HtmlGenericControl; 137 138 liS = this.FindControl("liS") as HtmlGenericControl; 139 liL = this.FindControl("liL") as HtmlGenericControl; 140 141 string openMode = wlContext.GetStringFromQueryString("mode", "s"); 142 143 if (openMode == "l") 144 { 145 blogDisplayAreaL.Visible = true; 146 blogDisplayAreaS.Visible = false; 147 148 liL.Attributes["class"] = "selected"; 149 liS.Attributes.Remove("class"); 150 } 151 else 152 { 153 blogDisplayAreaS.Visible = true; 154 blogDisplayAreaL.Visible = false; 155 156 liS.Attributes["class"] = "selected"; 157 liL.Attributes.Remove("class"); 158 } 159 } 160 161 void pager_PageIndexChanged(object sender, PagerEventArgs e) 162 { 163 this.BindPagingInfo(); 164 } 165 166 protected override void OnPreRender(EventArgs e) 167 { 168 base.OnPreRender(e); 169 this.BindPagingInfo(); 170 } 171 172 private void BindPagingInfo() 173 { 174 string openMode = wlContext.GetStringFromQueryString("mode", "s"); 175 EnsureChildControls(); 176 if (openMode == "l") 177 { 178 if (repeaterL != null ) 179 { 180 if (pager != null) 181 { 182 repeaterL.PageIndex = pager.PageIndex; 183 repeaterL.Bind(); 184 if (repeaterL.Entities != null && repeaterL.Entities.Records != null) 185 { 186 pager.TotalRecords = repeaterL.Entities.TotalRecords; 187 pager.PageSize = repeaterL.DisplayItemCount; 188 } 189 } 190 191 } 192 } 193 else 194 { 195 if (repeaterS != null) 196 { 197 if (pager != null) 198 { 199 repeaterS.PageIndex = pager.PageIndex; 200 repeaterS.Bind(); 201 if (repeaterS.Entities != null && repeaterS.Entities.Records != null) 202 { 203 pager.TotalRecords = repeaterS.Entities.TotalRecords; 204 pager.PageSize = repeaterS.DisplayItemCount; 205 } 206 } 207 208 } 209 } 210 } 211 212 213 214 属性 227 228 } 229} 230 231
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:SpaceBuilder v1.1源代码