FieldEditEnabler.cs
上传用户:husern
上传日期:2022-03-24
资源大小:534k
文件大小:2k
- // -- FILE ------------------------------------------------------------------
- // name : FieldEditEnabler.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.Web.UI.WebControls;
- namespace Itenso.WebUserForms.Controls
- {
- // ------------------------------------------------------------------------
- public class FieldEditEnabler : UserFormVisitor
- {
- // ----------------------------------------------------------------------
- public FieldEditEnabler( Control startControl, bool allowEdit )
- : base( startControl )
- {
- this.allowEdit = allowEdit;
- } // FieldEditEnabler
- // ----------------------------------------------------------------------
- public bool AllowEdit
- {
- get { return this.allowEdit; }
- } // AllowEdit
- // ----------------------------------------------------------------------
- public void Enable()
- {
- Start();
- } // Enable
- // ----------------------------------------------------------------------
- public static void Enable( Control startControl, bool allowEdit )
- {
- FieldEditEnabler fieldEditEnabler = new FieldEditEnabler( startControl, allowEdit );
- fieldEditEnabler.Enable();
- } // Enable
- // ----------------------------------------------------------------------
- protected override void VisitFormField( Control control,
- IUserFormField formField, IUserFormHeader formHeader )
- {
- formField.AllowEdit = allowEdit;
- } // VisitFormField
- // ----------------------------------------------------------------------
- // members
- private readonly bool allowEdit;
- } // class FieldEditEnabler
- } // namespace Itenso.WebUserForms.Controls
- // -- EOF -------------------------------------------------------------------