public void Control(DirectoryInfo directory) { var unzippedDirectory = directory.CreateSubdirectory("Unzipped"); var list = new List <TournamentParticipantExtraction>(); string exePath; ExtractionStatus status = ExtractionStatus.OK; foreach (var file in directory.GetFiles("*.zip")) { var name = file.Name.Substring(0, file.Name.IndexOf(".")); var outputDirectory = new DirectoryInfo(Path.Combine(unzippedDirectory.FullName, name)); TournamentParticipantExtraction res = null; if (status != ExtractionStatus.OK) { res = new TournamentParticipantExtraction { Participant = new TournamentParticipant { Id = int.Parse(name), PathToExe = null }, Status = status }; } else { res = CheckFolder(outputDirectory); } Console.WriteLine(res.Status); list.Add(res); } Json.Write("extract.json", list); }
private void Notify(ExtractionStatus status, string message) { this.NotifyProgress(new ExtractionEventArgs { Status = status, Message = message }); }