public FileDownloader(WoWRepository repository, List <FileObject> files) { Files = files; BasePath = repository.GetDefaultDirectory(); Progress = new ConsoleDownloadProgressBar(Files.Count); }
public FileDownloader(WoWRepository repository, List <FileObject> files) { Files = files; BasePath = repository.GetDefaultDirectory(); Progress = new ConsoleDownloadProgressBar(Files.Count); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new UI.ProgressBar()); }
private bool IsAcceptedFile(WoWRepository repository, FileObject file) { if (WoWRegeneration.CurrentSession.Os == "Win" && file.Filename == "base-OSX.MPQ") { return(false); } if (WoWRegeneration.CurrentSession.Os == "OSX" && file.Filename == "base-Win.MPQ") { return(false); } if (file.Filename == "alternate.MPQ" && WoWRegeneration.CurrentSession.Locale != "All" && file.Info != WoWRegeneration.CurrentSession.Locale) { return(false); } if (WoWRegeneration.CurrentSession.CompletedFiles.Contains(file.Path) && File.Exists(Program.ExecutionPath + repository.GetDefaultDirectory() + file.Path)) { Program.Log("Skipping " + file.Filename + " allready downloaded", ConsoleColor.DarkGray); return(false); } if (WoWRegeneration.CurrentSession.CompletedFiles.Contains(file.Path)) { WoWRegeneration.CurrentSession.CompletedFiles.Remove(file.Path); WoWRegeneration.CurrentSession.SaveSession(); } if (file.Directory == "Data/") { return(true); } if (file.Directory.StartsWith("Data/Interface/")) { return(true); } if (WoWRegeneration.CurrentSession.Locale == "All" || file.Directory.StartsWith("Data/" + WoWRegeneration.CurrentSession.Locale)) { return(true); } return(false); }