public void WipeFileNames() { var config = _configurationService.GetConfiguration(); var romFileWorker = new RomFileWorker(config); _currentBackgroundWorker = romFileWorker.BackgroundWorker; romFileWorker.BackgroundWorker.ProgressChanged += (sender, args) => { LoadScreenProgress = args.ProgressPercentage; }; romFileWorker.BackgroundWorker.RunWorkerCompleted += (sender, args) => { if (!args.Cancelled) { var romFiles = (List <RomFile>)args.Result; SetRomList(romFiles); NotifyOfPropertyChange(() => CanExport); } HideLoadScreen(); }; ShowLoadScreen("Wiping Rom-Names..."); romFileWorker.WipeFileNames(RomFiles.ToList()); }
public void Export() { var config = _configurationService.GetConfiguration(); var romFileWorker = new RomFileWorker(config); if (!Directory.Exists(DestinationDirectory)) { MessageBox.Show("The directory [" + DestinationDirectory + "] doesn't exist.", "Directory not found", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } _currentBackgroundWorker = romFileWorker.BackgroundWorker; romFileWorker.BackgroundWorker.ProgressChanged += (sender, args) => { LoadScreenProgress = args.ProgressPercentage; }; romFileWorker.BackgroundWorker.RunWorkerCompleted += (sender, args) => { HideLoadScreen(); }; ShowLoadScreen("Exporting wiped roms to [" + DestinationDirectory + "]..."); romFileWorker.Export(RomFiles.Where(r => r.Export).ToList()); }
public void ReadSourceRomFiles() { var config = _configurationService.GetConfiguration(); var romFileWorker = new RomFileWorker(config); if (!Directory.Exists(SourceDirectory)) { MessageBox.Show("The directory [" + SourceDirectory + "] doesn't exist.", "Directory not found", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } _currentBackgroundWorker = romFileWorker.BackgroundWorker; romFileWorker.BackgroundWorker.ProgressChanged += (sender, args) => { LoadScreenProgress = args.ProgressPercentage; }; romFileWorker.BackgroundWorker.RunWorkerCompleted += (sender, args) => { if (!args.Cancelled) { var romFiles = (List <RomFile>)args.Result; SetRomList(romFiles); NotifyOfPropertyChange(() => CanWipeFileNames); } HideLoadScreen(); }; ShowLoadScreen("Reading Rom-Files..."); romFileWorker.GetRomFiles(); }