/// <summary> /// Removes event handlers previously assigned to the ComboBox /// </summary> /// <param name="mapper">The mapper for the lookup ComboBox</param> public void RemoveCurrentHandlers(ILookupComboBoxMapper mapper) { _mapper = mapper; _mapper = mapper; ComboBoxWin comboBoxWin = this.ComboBox(mapper); if (comboBoxWin != null) { comboBoxWin.SelectedIndexChanged -= _mapper.SelectedIndexChangedHandler; } }
private ComboBoxWin ComboBox(ILookupComboBoxMapper mapper) { ComboBoxWin comboBoxWin = null; IControlHabanero control = mapper.Control; if (control is IComboBox) { comboBoxWin = (ComboBoxWin) control; } return comboBoxWin; }
/// <summary> /// Removes event handlers previously assigned to the ComboBox /// </summary> /// <param name="mapper">The mapper for the lookup ComboBox</param> public void RemoveCurrentHandlers(ILookupComboBoxMapper mapper) { _mapper = mapper; IControlHabanero control = mapper.Control; if (control is IComboBox) { ComboBoxWin comboBoxWin = (ComboBoxWin)control; comboBoxWin.SelectedIndexChanged -= SelectIndexChangedHandler; _mapper.SelectedIndexChangedHandler = null; } }
public void AddItemSelectedEventHandler(ILookupComboBoxMapper mapper) { _mapper = mapper; IControlHabanero control = mapper.Control; if (control is IComboBox) { ComboBoxWin comboBoxWin = (ComboBoxWin) control; comboBoxWin.SelectedIndexChanged += SelectIndexChangedHandler; _mapper.SelectedIndexChangedHandler = SelectIndexChangedHandler; } }
private ComboBoxWin ComboBox(ILookupComboBoxMapper mapper) { ComboBoxWin comboBoxWin = null; IControlHabanero control = mapper.Control; if (control is IComboBox) { comboBoxWin = (ComboBoxWin)control; } return(comboBoxWin); }
public void AddItemSelectedEventHandler(ILookupComboBoxMapper mapper) { _mapper = mapper; IControlHabanero control = mapper.Control; if (control is IComboBox) { ComboBoxWin comboBoxWin = (ComboBoxWin)control; comboBoxWin.SelectedIndexChanged += SelectIndexChangedHandler; _mapper.SelectedIndexChangedHandler = SelectIndexChangedHandler; } }
/// <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(); } }; } }
/// <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) { AddItemSelectedEventHandler(mapper); }