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

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : TimePicker.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 Itenso.WebUserForms.Controls;
  11. namespace Itenso.WebUserForms.RuntimeControls
  12. {
  13. #if TP_DATE_FIELDS
  14. // ------------------------------------------------------------------------
  15. public class TimePicker : System.Web.UI.WebControls.TextBox, IUserFormField
  16. {
  17. // ----------------------------------------------------------------------
  18. public TimePicker( Itenso.WebUserForms.Controls.TimePicker timePicker )
  19. {
  20. if ( timePicker == null )
  21. {
  22. throw new ArgumentNullException( "timePicker" );
  23. }
  24. // form values
  25. if ( !string.IsNullOrEmpty( timePicker.FieldName ) )
  26. {
  27. this.FieldName = timePicker.FieldName;
  28. }
  29. if ( !string.IsNullOrEmpty( timePicker.FieldValue ) )
  30. {
  31. this.FieldValue = timePicker.FieldValue;
  32. }
  33. // control values
  34. this.ID = timePicker.ID;
  35. this.Width = timePicker.Width;
  36. this.CssClass = timePicker.CssClass;
  37. } // TimePicker
  38. // ----------------------------------------------------------------------
  39. public string FieldName
  40. {
  41. get { return this.fieldName; }
  42. set { this.fieldName = value; }
  43. } // FieldName
  44. // ----------------------------------------------------------------------
  45. public string FieldValue
  46. {
  47. get { return Text; }
  48. set { Text = value; }
  49. } // FieldValue
  50. // ----------------------------------------------------------------------
  51. bool IUserFormField.AllowEdit
  52. {
  53. get { return !ReadOnly; }
  54. set { ReadOnly = !value; }
  55. } // AllowEdit
  56. // ----------------------------------------------------------------------
  57. public override string ToString()
  58. {
  59. return FormFieldTool.GetFieldDescription( this );
  60. } // ToString
  61. // ----------------------------------------------------------------------
  62. // members
  63. private string fieldName;
  64. } // class TimePicker
  65. #endif // TP_DATE_FIELDS
  66. } // namespace Itenso.WebUserForms.RuntimeControls
  67. // -- EOF -------------------------------------------------------------------