private void addCustomAPIButton_ButtonClick(object sender, EventArgs e) { using (EditAPI dialog = new EditAPI(_tableOrViewMapping.ContainingProject)) { if (dialog.ShowDialog() == DialogResult.OK) { dialog.API.JoinToTableMapping(_tableOrViewMapping); AddAPI(dialog.API); PropertyChanged(sender, e); } } }
private void EditAPI() { using (EditAPI dialog = new EditAPI(_tableOrViewMapping.ContainingProject, (API)apisListBox.SelectedItem)) { if (dialog.ShowDialog() == DialogResult.OK) { int itemIndex = apisListBox.SelectedIndex; apisListBox.Items.Remove(apisListBox.SelectedItem); apisListBox.Items.Insert(itemIndex, dialog.API); SaveOptions(); } } }