//------------------------------------------------------------------------------
// <copyright company="Telligent Systems">
//     Copyright (c) Telligent Systems Corporation.  All rights reserved.
// </copyright> 
//------------------------------------------------------------------------------

using System;
using System.Web.UI.WebControls;
using CommunityServer.Components;
using CommunityServer.ControlPanel.UI;

namespace CommunityServer.ControlPanel.Photos
{
	/// <summary>
	///		Summary description for ManageCategoriesControl.
	/// </summary>
	public class ManageCategoriesControl : BaseGalleryControl
	{
		protected ManageCategoriesTreeControl ManageCategoriesTreeControl1;
		protected ManageCategoryDetailsControl ManageCategoryDetailsControl1;
		protected ComponentArt.Web.UI.Splitter Splitter1;
		protected Label debugComment;

		private void Page_Load(object sender, EventArgs e)
		{
			ManageCategoriesTreeControl1.CategoryID = ManageCategoryDetailsControl1.CategoryID = CSContext.Current.GetIntFromQueryString("CategoryID",0);
		}

		#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);
			//ManageCategoriesTreeControl1.TreeChanged += new EventHandler(ManageCategoriesTreeControl1_TreeChanged);
		}
		
		/// <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 System.EventHandler(this.Page_Load);

		}

		#endregion

		private void ManageCategoriesTreeControl1_TreeChanged(object sender, EventArgs e)
		{
			debugComment.Text = "Caught TreeChanged Event! (" + ((ManageCategoriesTreeControl)sender).CategoryID.ToString()  + ")";
			ManageCategoryDetailsControl1.CategoryID = ((ManageCategoriesTreeControl)sender).CategoryID;
		}		
	}
}
