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

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : DatePicker.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 DatePicker : System.Web.UI.WebControls.TextBox, IUserFormField
  16. {
  17. // ----------------------------------------------------------------------
  18. public DatePicker( Itenso.WebUserForms.Controls.DatePicker datePicker )
  19. {
  20. if ( datePicker == null )
  21. {
  22. throw new ArgumentNullException( "datePicker" );
  23. }
  24. // form values
  25. if ( !string.IsNullOrEmpty( datePicker.FieldName ) )
  26. {
  27. this.FieldName = datePicker.FieldName;
  28. }
  29. if ( !string.IsNullOrEmpty( datePicker.FieldValue ) )
  30. {
  31. this.FieldValue = datePicker.FieldValue;
  32. }
  33. // control values
  34. this.ID = datePicker.ID;
  35. this.Width = datePicker.Width;
  36. this.CssClass = datePicker.CssClass;
  37. } // DatePicker
  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 DatePicker
  65. #endif // TP_DATE_FIELDS
  66. } // namespace Itenso.WebUserForms.RuntimeControls
  67. // -- EOF -------------------------------------------------------------------