private static IEnumerable <PathContainer> GetFilesRepository() { string repoDir = PathHelper.GetRepoPath(); string[] categoryDirs = Directory.GetDirectories(repoDir); foreach (string c in categoryDirs) { if (PathHelper.IsProject(c)) { List <PathContainer> categorys = GetFilesCategory(PathHelper.GetFilePath(c)).ToList(); foreach (PathContainer p in categorys) { yield return(p); } } } }
private static IEnumerable <PathContainer> GetFilesProduct(string filePath, string root = "") { string product = new FileInfo(filePath).Directory.Name; string productDir = new FileInfo(filePath).Directory.FullName; string[] scenarioDirs = Directory.GetDirectories(productDir); foreach (string d in scenarioDirs) { if (PathHelper.IsProject(d)) { List <PathContainer> scenarios = GetFilesScenario(PathHelper.GetFilePath(d)).ToList(); foreach (PathContainer s in scenarios) { yield return(new PathContainer(s.source, Path.Combine(root, product, s.relative))); } } } yield return(new PathContainer(filePath, Path.Combine(root, product, product + ".info"))); }
private static IEnumerable <PathContainer> GetFilesCategory(string filePath) { string category = new FileInfo(filePath).Directory.Name; string categoryDir = new FileInfo(filePath).Directory.FullName; string[] productDirs = Directory.GetDirectories(categoryDir); foreach (string d in productDirs) { if (PathHelper.IsProject(d)) { List <PathContainer> products = GetFilesProduct(PathHelper.GetFilePath(d)).ToList(); foreach (PathContainer p in products) { yield return(new PathContainer(p.source, Path.Combine(category, p.relative))); } } } yield return(new PathContainer(filePath, Path.Combine(category, category + ".info"))); }