private void comboBoxBolids_SelectedIndexChanged(object sender, EventArgs e) { HandlerFromFields handler = HandlersRepository.ListOfHandlers[comboBoxBolids.SelectedIndex]; ChangeFieldAccordingWithHandler(handler); changeModFlag = false; }
private void ChangeFieldAccordingWithHandler(HandlerFromFields handler) { for (int i = 0; i < handler.LabelNames.Length; i++) { labelsForBolids[i].Text = handler.LabelNames[i]; labelsForBolids[i].Visible = true; textboxForBolids[i].Visible = true; } for (int i = handler.LabelNames.Length; i < labelsForBolids.Length; i++) { labelsForBolids[i].Text = ""; labelsForBolids[i].Visible = false; textboxForBolids[i].Visible = false; } }
public void comboBoxObjects_SelectedIndexChanged(object sender, EventArgs e) { List <string> fields = new List <string>(); currentBolid = (Bolid)comboBoxObjects.SelectedItem; currentComboboxIndex = comboBoxObjects.SelectedIndex; int index = GetIndexOfHandler(currentBolid); comboBoxBolids.SelectedIndex = index; editingCreator = EditingCreatorRepository.ListOfEditingCreators[comboBoxBolids.SelectedIndex]; editingCreator.FactoryMethod(currentBolid, fields); HandlerFromFields handler = HandlersRepository.ListOfHandlers[comboBoxBolids.SelectedIndex]; ChangeFieldAccordingWithHandler(handler); FillFields(fields); changeModFlag = true; //bolidsRepository.Bolid.RemoveAt(currentComboboxIndex); }