PageRenderTime 13457ms CodeModel.GetById 53ms RepoModel.GetById 20ms app.codeStats 4ms

/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. using System;
  17. using System.Collections.Generic;
  18. using System.Text;
  19. using System.Collections.ObjectModel;
  20. using System.ComponentModel;
  21. using System.Web.UI;
  22. using System.Drawing.Design;
  23. using System.Diagnostics.CodeAnalysis;
  24. namespace IZ.WebFileManager
  25. {
  26. public sealed class NewDocumentTemplate : IStateManager
  27. {
  28. readonly StateBag bag = new StateBag ();
  29. [SuppressMessage ("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
  30. [Editor ("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (UITypeEditor))]
  31. [DefaultValue ("")]
  32. [UrlProperty]
  33. [Bindable (true)]
  34. public string SmallImageUrl {
  35. get { return bag ["SmallIconUrl"] == null ? String.Empty : (string) bag ["SmallIconUrl"]; }
  36. set { bag ["SmallIconUrl"] = value; }
  37. }
  38. [SuppressMessage ("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
  39. [Editor ("System.Web.UI.Design.UrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (UITypeEditor))]
  40. [DefaultValue ("")]
  41. [UrlProperty]
  42. [Bindable (true)]
  43. public string MasterFileUrl {
  44. get { return bag ["MasterFileUrl"] == null ? String.Empty : (string) bag ["MasterFileUrl"]; }
  45. set { bag ["MasterFileUrl"] = value; }
  46. }
  47. [SuppressMessage ("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")]
  48. [Editor ("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof (UITypeEditor))]
  49. [DefaultValue ("")]
  50. [UrlProperty]
  51. [Bindable (true)]
  52. public string LargeImageUrl {
  53. get { return bag ["LargeIconUrl"] == null ? String.Empty : (string) bag ["LargeIconUrl"]; }
  54. set { bag ["LargeIconUrl"] = value; }
  55. }
  56. [DefaultValue ("")]
  57. [Bindable (true)]
  58. public string Name {
  59. get { return bag ["Name"] == null ? String.Empty : (string) bag ["Name"]; }
  60. set { bag ["Name"] = value; }
  61. }
  62. [DefaultValue ("")]
  63. [Bindable (true)]
  64. public string NewFileName {
  65. get { return bag ["NewFileName"] == null ? String.Empty : (string) bag ["NewFileName"]; }
  66. set { bag ["NewFileName"] = value; }
  67. }
  68. #region IStateManager Members
  69. bool IStateManager.IsTrackingViewState {
  70. get { return ((IStateManager) bag).IsTrackingViewState; }
  71. }
  72. void IStateManager.LoadViewState (object state) {
  73. ((IStateManager) bag).LoadViewState (state);
  74. }
  75. object IStateManager.SaveViewState () {
  76. return ((IStateManager) bag).SaveViewState ();
  77. }
  78. void IStateManager.TrackViewState () {
  79. ((IStateManager) bag).TrackViewState ();
  80. }
  81. #endregion
  82. internal void SetDirty () {
  83. bag.SetDirty (true);
  84. }
  85. }
  86. }