📄 eventsection.cs
字号:
namespace ASPNET.StarterKit.Communities.Events {
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using ASPNET.StarterKit.Communities;
//*********************************************************************
//
// EventSection Class
//
// Represents the default page for the Events section. This class
// displays a list of event listings.
//
// _skinFileName = the name of the skin to use for this section
//
// _getContentItems = the name of the method that retrieves the list of content items
//
//*********************************************************************
public class EventSection : ContentListPage {
string _skinFileName = "Events_EventSection.ascx";
//*********************************************************************
//
// InitializeSkin Method
//
// In this case, we need to override the InitializeSkin method since
// we need to change the total records handler.
//
//*********************************************************************
override protected void InitializeSkin(Control skin) {
// Change the total records depending on edit ability
if (objUserInfo.MayEdit) {
TotalRecords = EventUtility.GetTotalRecordsWithInvisible(objSectionInfo.ID);
GetContentItems = new GetContentItemsDelegate(EventUtility.GetInvisibleEvents);
} else {
TotalRecords = EventUtility.GetTotalRecords(objSectionInfo.ID);
GetContentItems = new GetContentItemsDelegate(EventUtility.GetVisibleEvents);
}
// call the base method
base.InitializeSkin(skin);
}
//*********************************************************************
//
// EventSection Constructor
//
// Assigns skin and contentItems method to base ContentListPage class
//
//*********************************************************************
public EventSection() : base() {
SkinFileName = _skinFileName;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -