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

using System;

namespace CommunityServer.Blogs.Controls
{
	/// <summary>
	/// Enables the default layout of a page to be specified and overriden
	/// </summary>
	public class Page : WeblogThemedControl
	{
		public Page() : base()
		{
			//
			// TODO: Add constructor logic here
			//
		}

        private string _view;
        public string View
        {
            get{ return _view;}
            set{ _view = value;}
        }

        protected override string ExternalSkinFileName
        {
            get
            {
                
                return string.Format("Views/View-{0}.ascx",View);
            }
        }
        

	    /// <summary>
	    /// Override this method to attach templated or external skin controls to local references.
	    /// </summary>
	    protected override void AttachChildControls()
	    {
	        //Nothing to load
	    }

		protected override void Render(System.Web.UI.HtmlTextWriter writer)
		{
			SetDocType(writer);
			base.Render (writer);
		}

		[System.Diagnostics.Conditional("DEBUG")]
		protected void SetDocType(System.Web.UI.HtmlTextWriter writer)
		{
			writer.WriteLine(@"<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Frameset//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"">") ;
		}
	}
}
