private void toolStripButtonLoadConifg_Click(object sender, EventArgs e) { if ((cbxtoolStripSelectDataBase.ComboBox.SelectedIndex >= 0) && (cbxtoolStripSelectObejct.ComboBox.SelectedIndex >= 0)) { if (openFileDialogInputUIConfig.ShowDialog() == DialogResult.OK) { var uis = XmlConfigReader.GetConfig <FormUISetting>(openFileDialogInputUIConfig.FileName); var database = cbxtoolStripSelectDataBase.ComboBox.SelectedValue as IDatabase; for (int i = 0; i < cbxtoolStripSelectObejct.ComboBox.Items.Count; i++) { var table = (ITable)cbxtoolStripSelectObejct.ComboBox.Items[i]; if (table.Name == uis.TableName) { cbxtoolStripSelectObejct.ComboBox.SelectedIndex = i; break; } } dataGridViewField.DataSource = uis.Items; } } }
private void toolStripButtonLoadConifg_Click(object sender, EventArgs e) { if (this.cbxtoolStripSelectObejct.ComboBox.SelectedIndex >= 0) { if (this.openFileDialogInputUIConfig.ShowDialog() == DialogResult.OK) { FormUISetting uis = XmlConfigReader.GetConfig <FormUISetting>(this.openFileDialogInputUIConfig.FileName); ITable selectTable = this.cbxtoolStripSelectObejct.ComboBox.SelectedValue as MyMeta.ITable; IDatabase database = selectTable.Database; for (int i = 0; i < this.cbxtoolStripSelectObejct.ComboBox.Items.Count; i++) { ITable table = (ITable)this.cbxtoolStripSelectObejct.ComboBox.Items[i]; if (table.Name == uis.TableName) { this.cbxtoolStripSelectObejct.ComboBox.SelectedIndex = i; break; } } this.dataGridViewField.DataSource = uis.Items; } } }