private void buttonGetMAMEName_Click(object sender, EventArgs e) { try { textBoxRomName.Text = RomFunctions.GetMAMENameFromCSV(RomFunctions.GetFileNameNoExtension(textBoxFileName.Text)); } catch (Exception ex) { //FormWait.CloseWait(); FormCustomMessage.ShowError(ex.Message); } finally { //FormWait.CloseWait(); } }
private void buttonRemoveUnused_Click(object sender, EventArgs e) { Platform emu = (Platform)comboBoxChoosePlatform.SelectedItem; var roms = RomBusiness.GetAll().Where(x => x.Platform != null && x.Platform.Name == emu.Name).ToList(); var path = Environment.CurrentDirectory + "\\" + Values.PlatformsPath + "\\" + emu.Name + "\\"; int successfulFind = 0; var images = new List <string>(); if (radioButtonBoxart.Checked) { images = RomFunctions.GetRomPicturesByPlatformWithExt(comboBoxChoosePlatform.Text, Values.BoxartFolder); path += Values.BoxartFolder + "\\"; } else if (radioButtonTitle.Checked) { images = RomFunctions.GetRomPicturesByPlatformWithExt(comboBoxChoosePlatform.Text, Values.TitleFolder); path += Values.TitleFolder + "\\"; } else if (radioButtonGameplay.Checked) { images = RomFunctions.GetRomPicturesByPlatformWithExt(comboBoxChoosePlatform.Text, Values.GameplayFolder); path += Values.GameplayFolder + "\\"; } foreach (var image in images) { if (!roms.Any(x => x.FileNameNoExt.ToLower() == RomFunctions.GetFileNameNoExtension(image).ToLower())) { File.Delete(path + image); successfulFind++; } } FormCustomMessage.ShowSuccess("Number of successful unused rom pictures removed: " + successfulFind); }