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

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : ControlsAdapter.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.Web.UI;
  11. using System.Diagnostics;
  12. using Itenso.WebUserForms.Controls;
  13. using Itenso.WebUserForms.Runtime;
  14. namespace Itenso.WebUserForms.RuntimeControls
  15. {
  16. // ------------------------------------------------------------------------
  17. public class ControlsAdapter : RuntimeControlsAdapter
  18. {
  19. // ----------------------------------------------------------------------
  20. public ControlsAdapter( Control startControl )
  21. : base( startControl )
  22. {
  23. } // ControlsAdapter
  24. // ----------------------------------------------------------------------
  25. protected override Control GetRuntimeControl( Control placeholderControl )
  26. {
  27. #if (LOOKUP_FIELDS && TP_COMBO_FIELDS)
  28. Itenso.WebUserForms.Controls.LookupComboBox lookupComboBox = placeholderControl as Itenso.WebUserForms.Controls.LookupComboBox;
  29. if ( lookupComboBox != null )
  30. {
  31. return new LookupComboBox( lookupComboBox );
  32. }
  33. #endif // LOOKUP_FIELDS && TP_COMBO_FIELDS
  34. #if TP_COMBO_FIELDS
  35. Itenso.WebUserForms.Controls.ComboBox comboBox = placeholderControl as Itenso.WebUserForms.Controls.ComboBox;
  36. if ( comboBox != null )
  37. {
  38. return new ComboBox( comboBox );
  39. }
  40. #endif // TP_COMBO_FIELDS
  41. #if TP_DATE_FIELDS
  42. Itenso.WebUserForms.Controls.DatePicker datePicker = placeholderControl as Itenso.WebUserForms.Controls.DatePicker;
  43. if ( datePicker != null )
  44. {
  45. return new DatePicker( datePicker );
  46. }
  47. #endif // TP_DATE_FIELDS
  48. #if TP_DATE_FIELDS
  49. Itenso.WebUserForms.Controls.TimePicker timePicker = placeholderControl as Itenso.WebUserForms.Controls.TimePicker;
  50. if ( timePicker != null )
  51. {
  52. return new TimePicker( timePicker );
  53. }
  54. #endif // TP_DATE_FIELDS
  55. return null;
  56. } // GetRuntimeControl
  57. } // class ControlsAdapter
  58. } // namespace Itenso.WebUserForms.RuntimeControls
  59. // -- EOF -------------------------------------------------------------------