public void AddOrUpdateEmulator(string Name, string Path, string Args, int idx = -1) { Emulator newEmu = new Emulator(); newEmu.Name = Name; newEmu.Path = Path; newEmu.Arguments = Args; mLogger.Info(String.Format("Adding new emulator {0}", newEmu.ToString())); mLoadedConfig.AddOrUpdateEmulator(newEmu, idx); onLoadedConfigChanged(); }
public void AddOrUpdateEmulator(Emulator emu, int idx = -1) { if (idx != -1) { emu.Id = idx; Emulator emuToReplace = GetEmulatorById(idx); var associatedPaths = Paths.Where(f => f.AssociatedEmulator == emuToReplace.Name).ToList(); int deadEmulatorIndex = Emulators.IndexOf(emuToReplace); Emulators[deadEmulatorIndex] = emu; foreach(RomPath path in associatedPaths) { path.AssociatedEmulator = emu.Name; } } else { emu.Id = currEmuId; currEmuId++; Emulators.Add(emu); } isDirty = true; }
public EmulatorTreeNode(Emulator emu) { Text = emu.Name; Emulator = emu; }
private void DeleteEmulator_Click(Emulator emulator, object p) { String warning = String.Format("Are you sure you want to remove {0} from the emulator manager?", emulator.Name); DialogResult res = MessageBox.Show(this, warning, "CAUTION",MessageBoxButtons.OKCancel); if(res == DialogResult.OK) { mLogger.Info(String.Format("Removing emulator {0}", emulator.Name)); mConfigurationComponent.RemoveEmulator(emulator.Id); } }