UserFormHeader.cs
上传用户:husern
上传日期:2022-03-24
资源大小:534k
文件大小:5k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : UserFormHeader.cs
  3. // project    : Itenso Web User Forms
  4. // created    : Jani Giannoudis - 2008.10.30
  5. // language   : c#
  6. // environment: .NET 2.0
  7. // copyright  : (c) 2008 by Itenso GmbH, Switzerland
  8. // --------------------------------------------------------------------------
  9. using System;
  10. using System.Drawing;
  11. using System.ComponentModel;
  12. using System.Web.UI;
  13. using System.Web.UI.WebControls;
  14. using System.Web.UI.Design;
  15. namespace Itenso.WebUserForms.Controls
  16. {
  17. // ------------------------------------------------------------------------
  18. [DefaultProperty( "Name" )]
  19. [ToolboxBitmap( typeof( ResFinder ), "Itenso.WebUserForms.Controls.Images.UserForm.png" )]
  20. [ControlBuilder( typeof( UserFormHeaderBuilder ) )]
  21. [Designer( typeof( UserFormHeaderDesigner ) )]
  22. public class UserFormHeader : System.Web.UI.WebControls.HiddenField, IUserFormHeader
  23. {
  24. // ----------------------------------------------------------------------
  25. [DefaultValue( "" )]
  26. [Description( "UserFormHeader Form Type" )]
  27. [Category( "Web User Forms" )]
  28. public string Type
  29. {
  30. get { return this.type; }
  31. set { this.type = value; }
  32. } // Type
  33. // ----------------------------------------------------------------------
  34. [DefaultValue( "" )]
  35. [Description( "UserFormHeader Form Name" )]
  36. [Category( "Web User Forms" )]
  37. public string Name
  38. {
  39. get { return this.name; }
  40. set { this.name = value; }
  41. } // Name
  42. // ----------------------------------------------------------------------
  43. [DefaultValue( "" )]
  44. [Description( "UserFormHeader Description" )]
  45. [Category( "Web User Forms" )]
  46. public string Description
  47. {
  48. get { return this.description; }
  49. set { this.description = value; }
  50. } // Description
  51. // ----------------------------------------------------------------------
  52. [DefaultValue( "" )]
  53. [Description( "UserFormHeader Version" )]
  54. [Category( "Web User Forms" )]
  55. public string Version
  56. {
  57. get { return this.version; }
  58. set { this.version = value; }
  59. } // Version
  60. // ----------------------------------------------------------------------
  61. [Browsable( false )]
  62. public string FormId
  63. {
  64. get { return ViewState[ "FormId" ] as string; }
  65. set { ViewState[ "FormId" ] = value; }
  66. } // FormId
  67. // ----------------------------------------------------------------------
  68. [Browsable( false )]
  69. public string FormType
  70. {
  71. get { return ViewState[ "FormType" ] as string; }
  72. set { ViewState[ "FormType" ] = value; }
  73. } // FormType
  74. // ----------------------------------------------------------------------
  75. [Browsable( false )]
  76. public string FormName
  77. {
  78. get { return ViewState[ "FormName" ] as string; }
  79. set { ViewState[ "FormName" ] = value; }
  80. } // FormName
  81. // ----------------------------------------------------------------------
  82. [Browsable( false )]
  83. public DateTime? FormCreated
  84. {
  85. get 
  86. {
  87. object created = ViewState[ "FormCreated" ];
  88. if ( created != null )
  89. {
  90. return (DateTime)created;
  91. }
  92. return null;
  93. }
  94. set { ViewState[ "FormCreated" ] = value; }
  95. } // FormCreated
  96. // ----------------------------------------------------------------------
  97. [Browsable( false )]
  98. public string FormCreatedByUser
  99. {
  100. get { return ViewState[ "FormCreatedByUser" ] as string; }
  101. set { ViewState[ "FormCreatedByUser" ] = value; }
  102. } // FormCreatedByUser
  103. // ----------------------------------------------------------------------
  104. [Browsable( false )]
  105. public DateTime? FormLastUpdated
  106. {
  107. get
  108. {
  109. object created = ViewState[ "FormLastUpdated" ];
  110. if ( created != null )
  111. {
  112. return (DateTime)created;
  113. }
  114. return null;
  115. }
  116. set { ViewState[ "FormLastUpdated" ] = value; }
  117. } // FormLastUpdated
  118. // ----------------------------------------------------------------------
  119. [Browsable( false )]
  120. public string FormLastUpdatedByUser
  121. {
  122. get { return ViewState[ "FormLastUpdatedByUser" ] as string; }
  123. set { ViewState[ "FormLastUpdatedByUser" ] = value; }
  124. } // FormLastUpdatedByUser
  125. // ----------------------------------------------------------------------
  126. [Browsable( false )]
  127. public string FormVersion
  128. {
  129. get { return ViewState[ "FormVersion" ] as string; }
  130. set { ViewState[ "FormVersion" ] = value; }
  131. } // FormVersion
  132. // ----------------------------------------------------------------------
  133. public override string ToString()
  134. {
  135. if ( string.IsNullOrEmpty( this.type ) )
  136. {
  137. return string.IsNullOrEmpty( this.name ) ?
  138. string.Empty : this.name;
  139. }
  140. return string.IsNullOrEmpty( this.name ) ?
  141. this.type : string.Concat( this.type + " - " + name );
  142. } // ToString
  143. // ----------------------------------------------------------------------
  144. // members
  145. private string type;
  146. private string name;
  147. private string description;
  148. private string version;
  149. } // class UserFormHeader
  150. } // namespace Itenso.WebUserForms.Controls
  151. // -- EOF -------------------------------------------------------------------