PageRenderTime 102ms CodeModel.GetById 60ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 0ms

/IZWebFileManager/FileManagerCommand.cs

http://izwebfilemanager.googlecode.com/
C# | 102 lines | 65 code | 15 blank | 22 comment | 5 complexity | 2802238b1cf19c7bababd2ef5c6250c3 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.Web.UI;
 21using System.Collections.ObjectModel;
 22using System.ComponentModel;
 23using System.Drawing.Design;
 24using System.Diagnostics.CodeAnalysis;
 25
 26namespace IZ.WebFileManager
 27{
 28	public sealed class FileManagerCommand : IStateManager
 29	{
 30		readonly StateBag bag = new StateBag ();
 31
 32		//private FileManagerCommandTargets usage = FileManagerCommandTargets.All;
 33		//[DefaultValue(FileManagerCommandTargets.All)]
 34		//public FileManagerCommandTargets Usage
 35		//{
 36		//    get { return usage; }
 37		//    set { usage = value; }
 38		//}
 39
 40		[DefaultValue ("")]
 41		public string Name {
 42			get { return bag ["Name"] == null ? String.Empty : (string) bag ["Name"]; }
 43			set { bag ["Name"] = value; }
 44		}
 45
 46		[DefaultValue ("")]
 47		public string CommandName {
 48			get { return bag ["CommandName"] == null ? String.Empty : (string) bag ["CommandName"]; }
 49			set { bag ["CommandName"] = value; }
 50		}
 51
 52		[DefaultValue ("")]
 53		public string CommandArgument {
 54			get { return bag ["CommandArgument"] == null ? String.Empty : (string) bag ["CommandArgument"]; }
 55			set { bag ["CommandArgument"] = value; }
 56		}
 57
 58		[SuppressMessage ("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
 59		[Editor ("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (UITypeEditor))]
 60		[DefaultValue ("")]
 61		[UrlProperty]
 62		[Bindable (true)]
 63		public string SmallImageUrl {
 64			get { return bag ["SmallImageUrl"] == null ? String.Empty : (string) bag ["SmallImageUrl"]; }
 65			set { bag ["SmallImageUrl"] = value; }
 66		}
 67
 68		[SuppressMessage ("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
 69		[Editor ("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (UITypeEditor))]
 70		[DefaultValue ("")]
 71		[UrlProperty]
 72		[Bindable (true)]
 73		public string LargeImageUrl {
 74			get { return bag ["LargeImageUrl"] == null ? String.Empty : (string) bag ["LargeImageUrl"]; }
 75			set { bag ["LargeImageUrl"] = value; }
 76		}
 77
 78		internal void SetDirty () {
 79			bag.SetDirty (true);
 80		}
 81
 82		#region IStateManager Members
 83
 84		bool IStateManager.IsTrackingViewState {
 85			get { return ((IStateManager) bag).IsTrackingViewState; }
 86		}
 87
 88		void IStateManager.LoadViewState (object state) {
 89			((IStateManager) bag).LoadViewState (state);
 90		}
 91
 92		object IStateManager.SaveViewState () {
 93			return ((IStateManager) bag).SaveViewState ();
 94		}
 95
 96		void IStateManager.TrackViewState () {
 97			((IStateManager) bag).TrackViewState ();
 98		}
 99
100		#endregion
101	}
102}