Пример #1
0
 /// <summary>
 /// Constructor to instantiate a new instance of the class
 /// </summary>
 /// <param name="ctl">The control object to map</param>
 /// <param name="propName">The property name</param>
 /// <param name="isReadOnly">Whether the control is read only.
 /// If so, it then becomes disabled.  If not,
 /// handlers are assigned to manage key presses.</param>
 /// <param name="factory"></param>
 protected ControlMapper(IControlHabanero ctl, string propName, bool isReadOnly, IControlFactory factory)
 {
     if (ctl == null)
     {
         throw new ArgumentNullException("ctl");
     }
     if (factory == null)
     {
         throw new ArgumentNullException("factory");
     }
     Control        = ctl;
     PropertyName   = propName;
     IsReadOnly     = isReadOnly;
     ControlFactory = factory;
     ErrorProvider  = ControlFactory.CreateErrorProvider();
     if (!IsReadOnly)
     {
         AddKeyPressHandlers();
     }
     UpdateIsEditable();
 }
Пример #2
0
 /// <summary>
 /// Constructor to instantiate a new instance of the class
 /// </summary>
 /// <param name="ctl">The control object to map</param>
 /// <param name="propName">The property name</param>
 /// <param name="isReadOnly">Whether the control is read only.
 /// If so, it then becomes disabled.  If not,
 /// handlers are assigned to manage key presses.</param>
 /// <param name="factory"></param>
 protected ControlMapper(IControlHabanero ctl, string propName, bool isReadOnly, IControlFactory factory)
 {
     if (ctl == null) throw new ArgumentNullException("ctl");
     if (factory == null) throw new ArgumentNullException("factory");
     Control = ctl;
     PropertyName = propName;
     IsReadOnly = isReadOnly;
     ControlFactory = factory;
     ErrorProvider = ControlFactory.CreateErrorProvider();
     if (!IsReadOnly)
     {
         AddKeyPressHandlers();
     }
     UpdateIsEditable();
 }