⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 categorizationoptions.aspx.cs

📁 community server 源码
💻 CS
字号:
//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI.WebControls;
using CommunityServer.ControlPanel.Controls;
using CommunityServer.ControlPanel.UI;
using CommunityServer.Controls;
using CommunityServer.Galleries;
using CommunityServer.Galleries.Components;
using FormLabel = CommunityServer.ControlPanel.Controls.FormLabel;
using ResourceControl = CommunityServer.ControlPanel.Controls.ResourceControl;
using HelpIcon = CommunityServer.ControlPanel.Controls.HelpIcon;
using ResourceLinkButton = CommunityServer.ControlPanel.Controls.ResourceLinkButton;


namespace CommunityServerWeb.ControlPanel.Photos.Options
{
	/// <summary>
	/// Summary description for CategorizationOptions.
	/// </summary>
	public class CategorizationOptions : BaseGalleryPage
	{
		#region Child Controls

		protected ResourceLinkButton SaveButton;
		protected DropDownList CategorizeBy;

		#endregion
	
		private void Page_Load(object sender, EventArgs e)
		{
			if(!IsPostBack)
			{
				CategorizeBy.Items.Add(new ListItem(CommunityServer.ControlPanel.Components.ResourceManager.GetString("CP_Photos_CategorizationOptions_CategorizeByTags"), ((int) CategorizationType.Tag).ToString()));
				CategorizeBy.Items.Add(new ListItem(CommunityServer.ControlPanel.Components.ResourceManager.GetString("CP_Photos_CategorizationOptions_CategorizeByAlbums"), ((int) CategorizationType.Album).ToString()));

				CategorizeBy.SelectedValue = ((int) this.CurrentGallery.CategorizationType).ToString();
			}
		}

		#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);
			this.SaveButton.Click += new EventHandler(SaveButton_Click);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new EventHandler(this.Page_Load);

		}
		#endregion

		private void SaveButton_Click(object sender, EventArgs e)
		{
			if(Page.IsValid)
			{
				CurrentGallery.CategorizationType = (CategorizationType) int.Parse(CategorizeBy.SelectedValue);

				CommunityServer.Galleries.Galleries.Update(CurrentGallery);

				// need to redirect so the NavBar gets updated...
				Response.Redirect(Request.Url.ToString());
			}
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -