private void AddNewPathToEmulator_Click(EmulatorTreeNode selectedNode, object p) { Emulator selectedEmulator = selectedNode.Emulator; using (RomPathManagementWindow mModifyPathsForm = new RomPathManagementWindow()) { mModifyPathsForm.Initialize(selectedEmulator.Name); if (mModifyPathsForm.ShowDialog(this) == DialogResult.OK) { String path = mModifyPathsForm.RomPath; String associatedEmulator = mModifyPathsForm.EmulatorToUse; String extension = mModifyPathsForm.EmulatorExtension; mConfigurationComponent.AddRomPath(path, associatedEmulator, extension); } } }
private void addNewPaths_Click(object sender, EventArgs e) { if(mLoadedEmulators.Count == 0) { String err = "Cannot add a new path as no emulators have been defined in the current configuration! Add a new emulator first."; mLogger.Warn(err); MessageBox.Show(this, err, "Error"); } else { using (RomPathManagementWindow mModifyPathsForm = new RomPathManagementWindow()) { mLogger.Info("ModifyPaths clicked, displaying form"); var loadedEmulators = mLoadedEmulators.Select(f => f.Name).ToArray(); mModifyPathsForm.Initialize(loadedEmulators); if (mModifyPathsForm.ShowDialog(this) == DialogResult.OK) { String path = mModifyPathsForm.RomPath; String associatedEmulator = mModifyPathsForm.EmulatorToUse; String extension = mModifyPathsForm.EmulatorExtension; mConfigurationComponent.AddRomPath(path, associatedEmulator,extension); } } } }