您目前尚未登陆,请选择【登陆】或【注册
首页->博客论坛->SpaceBuilder v1.0正式版源码>>BlogControls/Club/BlogThreadListForClub.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:SpaceBuilder v1.0正式版源码
普通视图
		            
1//------------------------------------------------------------------------------ 2// <copyright company="Tunynet"> 3// Copyright (c) Tunynet Network Technology Co., Ltd. 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 public class BlogThreadListForClub : ClubDomainThemedControl 27 { 28 private SBContext wlContext = null; 29 30 OnInit 54 55 Child Controls 69 70 protected override void AttachChildControls() 71 { 72 HyClubBlogListForTab = this.FindControl("HyClubBlogListForTab") as HtmlAnchor; 73 HyClubBlogSummaryForTab = this.FindControl("HyClubBlogSummaryForTab") as HtmlAnchor; 74 75 76 if (this.HyClubBlogSummaryForTab != null) 77 { 78 HyClubBlogSummaryForTab.HRef = ClubUrls.Instance().BlogHome(CurrentClubDomainName); 79 if (HyClubBlogSummaryForTab.HRef.Contains("?") == true) 80 { 81 HyClubBlogSummaryForTab.HRef += "&mode=s"; 82 } 83 else 84 { 85 HyClubBlogSummaryForTab.HRef += "?mode=s"; 86 } 87 } 88 if (this.HyClubBlogListForTab != null) 89 { 90 HyClubBlogListForTab.HRef = ClubUrls.Instance().BlogHome(CurrentClubDomainName); 91 92 if (HyClubBlogListForTab.HRef.Contains("?") == true) 93 { 94 HyClubBlogListForTab.HRef += "&mode=l"; 95 } 96 else 97 { 98 HyClubBlogListForTab.HRef += "?mode=l"; 99 } 100 } 101 102 //if (this.HyClubBlogSummaryForTab != null) 103 //{ 104 // HyClubBlogSummaryForTab.HRef = ChannelUrls.Instance().ClubBlogSummaryForTab(CurrentClub.DomainName, 10, (int)SortThreadsBy.LastRepliedDate, (int)SortOrder.Descending); 105 //} 106 107 //if (this.HyClubBlogListForTab != null) 108 //{ 109 // HyClubBlogListForTab.HRef = ChannelUrls.Instance().ClubBlogListForTab(CurrentClub.DomainName, 20, (int)SortThreadsBy.LastRepliedDate, (int)SortOrder.Descending); 110 //} 111 112 //breadCrumb = FindControl("BreadCrumb") as Literal; 113 114 repeaterS = FindControl("repeaterS") as CommendedBlogThreadListRepeater; 115 repeaterL = FindControl("repeaterL") as CommendedBlogThreadListRepeater; 116 pager = FindControl("pager") as PostBackPager; 117 pager.PageIndexChanged += new PagerEventHandler(pager_PageIndexChanged); 118 119 HtmlGenericControl blogDisplayAreaL = this.FindControl("blogDisplayAreaL") as HtmlGenericControl; 120 HtmlGenericControl blogDisplayAreaS = this.FindControl("blogDisplayAreaS") as HtmlGenericControl; 121 122 liS = this.FindControl("liS") as HtmlGenericControl; 123 liL = this.FindControl("liL") as HtmlGenericControl; 124 125 string openMode = wlContext.GetStringFromQueryString("mode", "s"); 126 127 if (openMode == "l") 128 { 129 blogDisplayAreaL.Visible = true; 130 blogDisplayAreaS.Visible = false; 131 132 liL.Attributes["class"] = "selected"; 133 liS.Attributes.Remove("class"); 134 } 135 else 136 { 137 blogDisplayAreaS.Visible = true; 138 blogDisplayAreaL.Visible = false; 139 140 liS.Attributes["class"] = "selected"; 141 liL.Attributes.Remove("class"); 142 } 143 } 144 145 void pager_PageIndexChanged(object sender, PagerEventArgs e) 146 { 147 this.BindPagingInfo(); 148 } 149 150 protected override void OnPreRender(EventArgs e) 151 { 152 base.OnPreRender(e); 153 this.BindPagingInfo(); 154 } 155 156 private void BindPagingInfo() 157 { 158 string openMode = wlContext.GetStringFromQueryString("mode", "s"); 159 EnsureChildControls(); 160 if (openMode == "l") 161 { 162 if (repeaterL != null ) 163 { 164 if (pager != null) 165 { 166 repeaterL.PageIndex = pager.PageIndex; 167 repeaterL.Bind(); 168 if (repeaterL.Entities != null && repeaterL.Entities.Records != null) 169 { 170 pager.TotalRecords = repeaterL.Entities.TotalRecords; 171 pager.PageSize = repeaterL.DisplayItemCount; 172 } 173 } 174 175 } 176 } 177 else 178 { 179 if (repeaterS != null) 180 { 181 if (pager != null) 182 { 183 repeaterS.PageIndex = pager.PageIndex; 184 repeaterS.Bind(); 185 if (repeaterS.Entities != null && repeaterS.Entities.Records != null) 186 { 187 pager.TotalRecords = repeaterS.Entities.TotalRecords; 188 pager.PageSize = repeaterS.DisplayItemCount; 189 } 190 } 191 192 } 193 } 194 } 195 196 197 198 属性 211 212 } 213} 214 215
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:SpaceBuilder v1.0正式版源码