?? sectionadvanced.ascx.cs
字號:
namespace ASPNET.StarterKit.Communities.Admin.EditSections
{
using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
/// <summary>
/// Summary description for SectionAdvanced.
/// </summary>
public abstract class SectionAdvanced : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.RadioButtonList radlAllowHtmlInput;
protected System.Web.UI.WebControls.RadioButtonList radlAllowCommentHtmlInput;
protected System.Web.UI.WebControls.CompareValidator CompareValidator1;
protected System.Web.UI.WebControls.TextBox txtRecordsPerPage;
protected System.Web.UI.WebControls.CheckBox chkEnableComments;
protected System.Web.UI.WebControls.CheckBox chkEnableTopics;
protected System.Web.UI.WebControls.CheckBox chkEnableNotifications;
protected System.Web.UI.WebControls.CheckBox chkEnableModeration;
protected System.Web.UI.WebControls.CheckBox chkEnableRatings;
protected System.Web.UI.WebControls.CheckBox chkEnableCommentRatings;
protected ListPicker ctlCommentRoles;
protected ListPicker ctlRateRoles;
protected ListPicker ctlModerateRoles;
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
public SectionInfo Section;
public ArrayList AllRoles;
public AllowHtml AllowHtmlInput {
get { return (AllowHtml)AllowHtml.Parse( typeof(AllowHtml), radlAllowHtmlInput.SelectedItem.Value); }
}
public AllowHtml AllowCommentHtmlInput {
get { return (AllowHtml)AllowHtml.Parse( typeof(AllowHtml), radlAllowCommentHtmlInput.SelectedItem.Value); }
}
public int RecordsPerPage {
get { return Int32.Parse(txtRecordsPerPage.Text); }
}
public bool EnableComments {
get { return chkEnableComments.Checked; }
}
public bool CommentRolesChanged {
get { return ctlCommentRoles.Changed; }
}
public string[] CommentRoles {
get { return ctlCommentRoles.SelectedItems; }
}
public bool EnableTopics {
get { return chkEnableTopics.Checked; }
}
public bool EnableNotifications {
get { return chkEnableNotifications.Checked; }
}
public bool EnableModeration {
get { return chkEnableModeration.Checked; }
set { chkEnableModeration.Checked = value; }
}
public bool ModerateRolesChanged {
get { return ctlModerateRoles.Changed; }
}
public string[] ModerateRoles {
get { return ctlModerateRoles.SelectedItems; }
}
public bool EnableRatings {
get { return chkEnableRatings.Checked; }
}
public bool EnableCommentRatings {
get { return chkEnableCommentRatings.Checked; }
}
public string[] RateRoles {
get { return ctlRateRoles.SelectedItems; }
}
public bool RateRolesChanged {
get { return ctlRateRoles.Changed; }
}
void Page_Load(object sender, System.EventArgs e) {
if (!IsPostBack) {
ctlCommentRoles.DataSource = AllRoles;
ctlModerateRoles.DataSource = AllRoles;
ctlRateRoles.DataSource = AllRoles;
if (Section != null) {
radlAllowHtmlInput.Items.FindByValue(Section.AllowHtmlInput.ToString()).Selected = true;
radlAllowCommentHtmlInput.Items.FindByValue(Section.AllowCommentHtmlInput.ToString()).Selected = true;
txtRecordsPerPage.Text = Section.RecordsPerPage.ToString();
chkEnableComments.Checked = Section.EnableComments;
chkEnableTopics.Checked = Section.EnableTopics;
chkEnableNotifications.Checked = Section.EnableNotifications;
chkEnableModeration.Checked = Section.EnableModeration;
chkEnableRatings.Checked = Section.EnableRatings;
chkEnableCommentRatings.Checked = Section.EnableCommentRatings;
ctlCommentRoles.SelectedItems = Section.CommentRoles;
ctlModerateRoles.SelectedItems = Section.ModerateRoles;
ctlRateRoles.SelectedItems = Section.RateRoles;
} else {
// Assign default values
radlAllowHtmlInput.Items[1].Selected = true;
radlAllowCommentHtmlInput.Items[1].Selected = true;
chkEnableComments.Checked = true;
ctlCommentRoles.SelectedItems = new string[] {"Community-Authenticated"};
chkEnableNotifications.Checked = true;
ctlModerateRoles.SelectedItems = new string[] {"Community-Administrators", "Community-Moderators"};
ctlRateRoles.SelectedItems = new string[] {"Community-Administrators"};
}
DataBind();
}
}
private void Page_Load()
{
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -