Esempio n. 1
0
 private void SelectIndexChangedHandler(object sender, EventArgs e)
 {
     try
     {
         _mapper.ApplyChangesToBusinessObject();
     }
     catch (Exception ex)
     {
         GlobalRegistry.UIExceptionNotifier.Notify(ex, "", "Error");
     }
 }
 /// <summary>
 /// Adds event handlers to the ComboBox that are suitable for the UI environment
 /// </summary>
 /// <param name="mapper">The mapper for the lookup ComboBox</param>
 public void AddHandlers(ILookupComboBoxMapper mapper)
 {
     ComboBoxWin comboBoxWin = this.ComboBox(mapper);
     if (comboBoxWin != null)
     {
         comboBoxWin.KeyPress += delegate(object sender, System.Windows.Forms.KeyPressEventArgs e)
         {
             if (e.KeyChar == 13)
             {
                 mapper.ApplyChangesToBusinessObject();
                 mapper.UpdateControlValueFromBusinessObject();
             }
         };
     }
 }
Esempio n. 3
0
        /// <summary>
        /// Adds event handlers to the ComboBox that are suitable for the UI environment
        /// </summary>
        /// <param name="mapper">The mapper for the lookup ComboBox</param>
        public void AddHandlers(ILookupComboBoxMapper mapper)
        {
            ComboBoxWin comboBoxWin = this.ComboBox(mapper);

            if (comboBoxWin != null)
            {
                comboBoxWin.KeyPress += delegate(object sender, System.Windows.Forms.KeyPressEventArgs e)
                {
                    if (e.KeyChar == 13)
                    {
                        mapper.ApplyChangesToBusinessObject();
                        mapper.UpdateControlValueFromBusinessObject();
                    }
                };
            }
        }