ControlsAdapter.cs
上传用户:husern
上传日期:2022-03-24
资源大小:534k
文件大小:2k
- // -- FILE ------------------------------------------------------------------
- // name : ControlsAdapter.cs
- // project : Itenso Web User Forms
- // created : Jani Giannoudis - 2008.10.30
- // language : c#
- // environment: .NET 2.0
- // copyright : (c) 2008 by Itenso GmbH, Switzerland
- // --------------------------------------------------------------------------
- using System;
- using System.Web.UI;
- using System.Diagnostics;
- using Itenso.WebUserForms.Controls;
- using Itenso.WebUserForms.Runtime;
- namespace Itenso.WebUserForms.RuntimeControls
- {
- // ------------------------------------------------------------------------
- public class ControlsAdapter : RuntimeControlsAdapter
- {
- // ----------------------------------------------------------------------
- public ControlsAdapter( Control startControl )
- : base( startControl )
- {
- } // ControlsAdapter
- // ----------------------------------------------------------------------
- protected override Control GetRuntimeControl( Control placeholderControl )
- {
- #if (LOOKUP_FIELDS && TP_COMBO_FIELDS)
- Itenso.WebUserForms.Controls.LookupComboBox lookupComboBox = placeholderControl as Itenso.WebUserForms.Controls.LookupComboBox;
- if ( lookupComboBox != null )
- {
- return new LookupComboBox( lookupComboBox );
- }
- #endif // LOOKUP_FIELDS && TP_COMBO_FIELDS
- #if TP_COMBO_FIELDS
- Itenso.WebUserForms.Controls.ComboBox comboBox = placeholderControl as Itenso.WebUserForms.Controls.ComboBox;
- if ( comboBox != null )
- {
- return new ComboBox( comboBox );
- }
- #endif // TP_COMBO_FIELDS
- #if TP_DATE_FIELDS
- Itenso.WebUserForms.Controls.DatePicker datePicker = placeholderControl as Itenso.WebUserForms.Controls.DatePicker;
- if ( datePicker != null )
- {
- return new DatePicker( datePicker );
- }
- #endif // TP_DATE_FIELDS
- #if TP_DATE_FIELDS
- Itenso.WebUserForms.Controls.TimePicker timePicker = placeholderControl as Itenso.WebUserForms.Controls.TimePicker;
- if ( timePicker != null )
- {
- return new TimePicker( timePicker );
- }
- #endif // TP_DATE_FIELDS
- return null;
- } // GetRuntimeControl
- } // class ControlsAdapter
- } // namespace Itenso.WebUserForms.RuntimeControls
- // -- EOF -------------------------------------------------------------------