private static IEnumerable <PathContainer> GetFilesTopic(string filePath, string root = "") { TopicModel topic = JsonConvert.DeserializeObject <TopicModel>(File.ReadAllText(filePath)); string[] localizations = PathHelper.GetAvailableLocalizations(); string scenarioFolder = filePath.Replace(new FileInfo(filePath).Name, "").Replace("topics", ""); //main topic info yield return(new PathContainer(filePath, Path.Combine(root, "topics", new FileInfo(filePath).Name))); foreach (string loc in localizations) { if (Directory.Exists(Path.Combine(scenarioFolder, loc))) { //projects yield return(new PathContainer("", Path.Combine(root, loc, "projects", "file.null"))); //pub_in yield return(new PathContainer("", Path.Combine(root, loc, "pub_in", "file.null"))); //pub_draft yield return(new PathContainer("", Path.Combine(root, loc, "pub_draft", "file.null"))); //pub_out yield return(new PathContainer("", Path.Combine(root, loc, "pub_out", "file.null"))); topic.localization = loc; string pathToZip = topic.pathToZip; string vmpPath = topic.vmpPath; if (!string.IsNullOrEmpty(topic.vmpPathDEFAULT)) { vmpPath = topic.vmpPathDEFAULT; } //zip if (!string.IsNullOrEmpty(pathToZip)) { yield return(new PathContainer(pathToZip, Path.Combine(root, loc, "pub_in", new FileInfo(pathToZip).Name))); } //vmp if (!string.IsNullOrEmpty(vmpPath)) { yield return(new PathContainer(vmpPath, Path.Combine(root, loc, "projects", new FileInfo(vmpPath).Name))); } //vmb if (!string.IsNullOrEmpty(vmpPath)) { yield return(new PathContainer(vmpPath.Replace(".vmp", ".vmb"), Path.Combine(root, loc, "projects", new FileInfo(vmpPath.Replace(".vmp", ".vmb")).Name))); } } } }