private void RenameButton_Click(object sender, EventArgs e) { var instance = (string)KSPInstancesListView.SelectedItems[0].Tag; renameInstanceDialog = new RenameInstanceDialog(); if (renameInstanceDialog.ShowRenameInstanceDialog(instance) == DialogResult.OK) { manager.RenameInstance(instance, renameInstanceDialog.GetResult()); UpdateInstancesList(); } }
private void RenameButton_Click(object sender, EventArgs e) { var instance = (string)KSPInstancesListView.SelectedItems[0].Tag; // show the dialog, and only continue if the user selected "OK" _renameInstanceDialog = new RenameInstanceDialog(); if (_renameInstanceDialog.ShowRenameInstanceDialog(instance) != DialogResult.OK) { return; } // proceed with instance rename _manager.RenameInstance(instance, _renameInstanceDialog.GetResult()); UpdateInstancesList(); }