public void SayMaximumProgress(Double totalProgress) { Debug.WriteLine($"{nameof(SayMaximumProgress)}: {totalProgress}"); MaximumProgress?.Invoke(this, totalProgress); }
private void Copy_LBManager(LBGame lbGame, string tempFolder) { // todo ajouter une fonctino pour grouper les jeux dans le sous dossier //string gameF = Path.Combine(Path.GetDirectoryName(lbGame.ApplicationPath), lbGame.Title); UpdateStatus?.Invoke(this, "Copy files"); MaximumProgress?.Invoke(this, 6); UpdateProgress?.Invoke(this, 0); int i = 0; foreach (string d in Directory.GetDirectories(tempFolder)) { UpdateProgress?.Invoke(this, i); string dirName = Path.GetFileName(d); // Games if (dirName == PS.Default.Games) { string tmp = Path.GetDirectoryName(lbGame.ApplicationPath); UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.Games} => '{tmp}'"); CopyContent(d, tmp); } // Cheat Codes else if (dirName == PS.Default.CheatCodes) { UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.CheatCodes} => '{TCheatsCodesP}'"); CopyContent(d, TCheatsCodesP); } // Images else if (dirName == PS.Default.Images) { UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.Images} => '{TImagesP}'"); CopyContent(d, TImagesP); } // Manuals else if (dirName == PS.Default.Manuals) { string tmp = Path.GetDirectoryName(lbGame.ManualPath); UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.Manuals} => ({ tmp }'"); CopyContent(d, tmp); } // Musics else if (dirName == PS.Default.Musics) { string tmp = Path.GetDirectoryName(lbGame.MusicPath); UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.Musics} => '{tmp}'"); CopyContent(d, tmp); } // Videos else if (dirName == PS.Default.Videos) { string tmp = Path.GetDirectoryName(lbGame.VideoPath); UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.Videos} => '{tmp}'"); CopyContent(d, tmp); } i++; } UpdateProgress?.Invoke(this, 6); }
/// <summary> /// /// </summary> /// <param name="tempFolder"></param> /// <param name="gameName"></param> /// <remarks> /// /// </remarks> private void Copy_TBManager(string tempFolder) { // todo ajouter une fonctino pour grouper les jeux dans le sous dossier //string gameF = Path.Combine(Path.GetDirectoryName(lbGame.ApplicationPath), lbGame.Title); UpdateStatus?.Invoke(this, "Copy files"); MaximumProgress?.Invoke(this, 6); UpdateProgress?.Invoke(this, 0); int i = 0; foreach (string d in Directory.GetDirectories(tempFolder)) { UpdateProgress?.Invoke(this, i); string dirName = Path.GetFileName(d); // Games if (dirName == PS.Default.Games) { // On passe /* * string tmp; * // prise en charge de la fonction pour placer dans un répertoire au nom du jeu * if (PS.Default.wGameNameFolder) * tmp = Path.Combine(TGamesP, Cst.WindowsConv_TitleToFileName(gameName)); * else * tmp = TGamesP; * * UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.Games} => '{tmp}'"); * CopyContent(d, tmp);*/ } // Cheat Codes else if (dirName == PS.Default.CheatCodes) { UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.CheatCodes} => '{TCheatsCodesP}'"); CopyContent(d, TCheatsCodesP); } // Images else if (dirName == PS.Default.Images) { // --- On passe } // Manuals else if (dirName == PS.Default.Manuals) { UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.Manuals} => ({ TManualsP }'"); CopyContent(d, TManualsP); } // Musics else if (dirName == PS.Default.Musics) { UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.Musics} => '{TMusicsP}'"); CopyContent(d, TMusicsP); } // Videos else if (dirName == PS.Default.Videos) { UpdateStatus?.Invoke(this, $"\t{Lang.I_Copy}: {Lang.Videos} => '{TVideosP}'"); CopyContent(d, TVideosP); } i++; } UpdateProgress?.Invoke(this, 6); }