private void toolStripComboBoxDomain_SelectedIndexChanged(object sender, EventArgs e) { if (tbldomain != null) { tbldomain.m_tblControllerCollection.ControllerChanged -= new ControllerChangedEventHandler(updateControllerComboventhandler); } tbldomain = (tblDomain)toolStripComboBoxDomain.SelectedItem; domainname = tbldomain.DomainName; domainid = tbldomain.DomainID; tbldomain.m_tblControllerCollection.ControllerChanged += new ControllerChangedEventHandler(updateControllerComboventhandler); if (tbldomain.m_tblControllerCollection.Count > 0) { updateControllerCombo(); toolStripComboBoxController.Enabled = true; } else { toolStripComboBoxController.Items.Clear(); toolStripComboBoxProgram.Items.Clear(); toolStripComboBoxController.Enabled = false; toolStripComboBoxProgram.Enabled = false; tblcontroller = null; tblpou = null; SelectVariable(); } }
private void updateDomainCombo() { toolStripComboBoxDomain.Items.Clear(); for (int i = 0; i < frm._tblSolution.m_tblDomainCollection.Count; i++) { toolStripComboBoxDomain.Items.Add(frm._tblSolution.m_tblDomainCollection[i]); } toolStripComboBoxDomain.ComboBox.DisplayMember = "DomainName"; toolStripComboBoxDomain.ComboBox.ValueMember = "DomainID"; if (tbldomain != null) { tbldomain.m_tblControllerCollection.ControllerChanged -= new ControllerChangedEventHandler(updateControllerComboventhandler); } if (toolStripComboBoxDomain.Items.Count > 0) { if (toolStripComboBoxDomain.SelectedIndex == -1) { toolStripComboBoxDomain.SelectedIndex = 0; } tbldomain = frm._tblSolution.m_tblDomainCollection[toolStripComboBoxDomain.SelectedIndex]; tbldomain.m_tblControllerCollection.ControllerChanged += new ControllerChangedEventHandler(updateControllerComboventhandler); updateControllerCombo(); } }