PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 5ms RepoModel.GetById 35ms app.codeStats 1ms

/IZWebFileManager/NewDocumentTemplate.cs

http://izwebfilemanager.googlecode.com/
C# | 101 lines | 71 code | 15 blank | 15 comment | 5 complexity | 68025a7df412dad1ec1492af392f753b MD5 | raw file
  1// Copyright (C) 2006 Igor Zelmanovich <izwebfilemanager@gmail.com>
  2//
  3// This program is free software; you can redistribute it and/or modify
  4// it under the terms of the GNU General Public License as published by
  5// the Free Software Foundation; either version 2 of the License, or
  6// (at your option) any later version.
  7//
  8// This program is distributed in the hope that it will be useful,
  9// but WITHOUT ANY WARRANTY; without even the implied warranty of
 10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 11// GNU General Public License for more details.
 12//
 13// You should have received a copy of the GNU General Public License
 14// along with this program; if not, write to the Free Software
 15// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 16
 17using System;
 18using System.Collections.Generic;
 19using System.Text;
 20using System.Collections.ObjectModel;
 21using System.ComponentModel;
 22using System.Web.UI;
 23using System.Drawing.Design;
 24using System.Diagnostics.CodeAnalysis;
 25
 26namespace IZ.WebFileManager
 27{
 28	public sealed class NewDocumentTemplate : IStateManager
 29	{
 30		readonly StateBag bag = new StateBag ();
 31
 32		[SuppressMessage ("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
 33		[Editor ("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (UITypeEditor))]
 34		[DefaultValue ("")]
 35		[UrlProperty]
 36		[Bindable (true)]
 37		public string SmallImageUrl {
 38			get { return bag ["SmallIconUrl"] == null ? String.Empty : (string) bag ["SmallIconUrl"]; }
 39			set { bag ["SmallIconUrl"] = value; }
 40		}
 41
 42		[SuppressMessage ("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
 43		[Editor ("System.Web.UI.Design.UrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (UITypeEditor))]
 44		[DefaultValue ("")]
 45		[UrlProperty]
 46		[Bindable (true)]
 47		public string MasterFileUrl {
 48			get { return bag ["MasterFileUrl"] == null ? String.Empty : (string) bag ["MasterFileUrl"]; }
 49			set { bag ["MasterFileUrl"] = value; }
 50		}
 51
 52		[SuppressMessage ("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
 53		[Editor ("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (UITypeEditor))]
 54		[DefaultValue ("")]
 55		[UrlProperty]
 56		[Bindable (true)]
 57		public string LargeImageUrl {
 58			get { return bag ["LargeIconUrl"] == null ? String.Empty : (string) bag ["LargeIconUrl"]; }
 59			set { bag ["LargeIconUrl"] = value; }
 60		}
 61
 62		[DefaultValue ("")]
 63		[Bindable (true)]
 64		public string Name {
 65			get { return bag ["Name"] == null ? String.Empty : (string) bag ["Name"]; }
 66			set { bag ["Name"] = value; }
 67		}
 68
 69		[DefaultValue ("")]
 70		[Bindable (true)]
 71		public string NewFileName {
 72			get { return bag ["NewFileName"] == null ? String.Empty : (string) bag ["NewFileName"]; }
 73			set { bag ["NewFileName"] = value; }
 74		}
 75
 76
 77		#region IStateManager Members
 78
 79		bool IStateManager.IsTrackingViewState {
 80			get { return ((IStateManager) bag).IsTrackingViewState; }
 81		}
 82
 83		void IStateManager.LoadViewState (object state) {
 84			((IStateManager) bag).LoadViewState (state);
 85		}
 86
 87		object IStateManager.SaveViewState () {
 88			return ((IStateManager) bag).SaveViewState ();
 89		}
 90
 91		void IStateManager.TrackViewState () {
 92			((IStateManager) bag).TrackViewState ();
 93		}
 94
 95		#endregion
 96
 97		internal void SetDirty () {
 98			bag.SetDirty (true);
 99		}
100	}
101}