private void comboBoxSwitch_SelectedIndexChanged_1(object sender, EventArgs e) { comboBoxRight.Enabled = (comboBoxSwitch.SelectedIndex != 0); // Then we make sure to initialize things properly if (comboBoxSwitch.SelectedIndex == 0 || comboBoxSwitch.SelectedIndex == 1) { CurrentSection.Switch = null; if (comboBoxSwitch.SelectedIndex == 1 && CurrentSection.RightSection == null) { CurrentSection.RightSection = Project.Sections[0]; } else { comboBoxRight.SelectedIndex = -1; } } else { DetectorItem item = (DetectorItem)comboBoxSwitch.SelectedItem; CurrentSection.Switch = item.GetFullID(); CurrentSection.LeftSection = (CurrentSection.LeftSection == null) ? Project.Sections[0] : CurrentSection.LeftSection; CurrentSection.RightSection = (CurrentSection.RightSection == null) ? Project.Sections[0] : CurrentSection.RightSection; } }
private void comboBoxDetector_SelectedIndexChanged(object sender, EventArgs e) { DetectorItem item = (DetectorItem)comboBoxDetector.SelectedItem; Section.Detector = item.GetFullID(); }