?? sectionwebboxes.ascx.cs
字號(hào):
namespace ASPNET.StarterKit.Communities.Admin.EditSections
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using ASPNET.StarterKit.Communities.Services;
/// <summary>
/// Summary description for SectionWebBoxes.
/// </summary>
public abstract class SectionWebBoxes : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.RadioButton rdlWebBoxInherit;
protected System.Web.UI.WebControls.RadioButton rdlWebBoxSelect;
protected System.Web.UI.WebControls.Panel pnlInheritWebBoxes;
protected System.Web.UI.WebControls.DropDownList dropWebBoxDisplayMode;
protected System.Web.UI.WebControls.RadioButton rdlWebServiceBoxInherit;
protected System.Web.UI.WebControls.RadioButton rdlWebServiceBoxSelect;
protected System.Web.UI.WebControls.Panel pnlInheritWebServiceBoxes;
protected System.Web.UI.WebControls.DropDownList dropWebServiceBoxDisplayMode;
protected ListPicker ctlWebBoxPicker;
protected ListPicker ctlWebServiceBoxPicker;
#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 bool InheritWebBoxes {
get { return rdlWebBoxInherit.Checked; }
}
public string[] WebBoxes {
get { return ctlWebBoxPicker.SelectedItems; }
}
public bool WebBoxesChanged {
get { return ctlWebBoxPicker.Changed; }
}
public int WebBoxDisplayMode {
get { return Int32.Parse(dropWebBoxDisplayMode.SelectedItem.Value); }
}
public bool InheritWebServiceBoxes {
get { return rdlWebServiceBoxInherit.Checked; }
}
public string[] WebServiceBoxes {
get { return ctlWebServiceBoxPicker.SelectedItems; }
}
public bool WebServiceBoxesChanged {
get { return ctlWebServiceBoxPicker.Changed; }
}
public int WebServiceBoxDisplayMode {
get { return Int32.Parse(dropWebServiceBoxDisplayMode.SelectedItem.Value); }
}
void Page_Load(object sender, System.EventArgs e) {
if (!IsPostBack) {
if (Section != null) {
// initialize inherited Web Box values
rdlWebBoxInherit.Checked = Section.IsWebBoxesInherited;
rdlWebBoxSelect.Checked = !Section.IsWebBoxesInherited;
// initialize inherited Web Service Box values
rdlWebServiceBoxInherit.Checked = Section.IsWebServiceBoxesInherited;
rdlWebServiceBoxSelect.Checked = !Section.IsWebServiceBoxesInherited;
// Initialize Web Box display mode
string strValue = Section.WebBoxDisplayMode.ToString();
foreach (ListItem item in dropWebBoxDisplayMode.Items)
if (item.Value == strValue)
item.Selected = true;
// Initialize Web Service Box display mode
strValue = Section.WebServiceBoxDisplayMode.ToString();
dropWebServiceBoxDisplayMode.SelectedIndex = -1;
foreach (ListItem item in dropWebServiceBoxDisplayMode.Items)
if (item.Value == strValue)
item.Selected = true;
// assign default values
ctlWebBoxPicker.SelectedItems = Section.WebBoxes;
ctlWebServiceBoxPicker.SelectedItems = Section.WebServiceBoxes;
// If home section, hide inherit options
if (Section.ParentSectionID == -1) {
pnlInheritWebBoxes.Visible = false;
pnlInheritWebServiceBoxes.Visible = false;
}
}
// initialize Web Boxes
ctlWebBoxPicker.DataSource = WebBoxUtility.GetAllWebBoxes();
ctlWebBoxPicker.DataBind();
ctlWebServiceBoxPicker.DataSource = ServiceUtility.GetAllServices();;
ctlWebServiceBoxPicker.DataField = "name";
ctlWebServiceBoxPicker.DataBind();
}
}
private void Page_Load()
{
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -