public BaseliningSummary RunUnder(string folderPath, string reportingName) { BaseliningSummary folderSummary = new BaseliningSummary(Path.GetFileName(folderPath)); // Recurse on subfolders, if found foreach (string subfolder in Directory.EnumerateDirectories(folderPath, "*", SearchOption.TopDirectoryOnly)) { BaseliningSummary part = RunUnder(subfolder, Path.Combine(reportingName, Path.GetFileName(subfolder))); folderSummary.AddComponent(part); } // Run series for leaf folders if (Directory.EnumerateFiles(folderPath).Any()) { BaseliningSummary seriesSummary = RunSeries(folderPath, reportingName); folderSummary.AddCounts(seriesSummary); } return(folderSummary); }
public BaseliningSummary RunUnder(string folderPath) { BaseliningSummary folderSummary = new BaseliningSummary(Path.GetFileName(folderPath)); // Recurse on subfolders, if found foreach (string subfolder in Directory.EnumerateDirectories(folderPath, "*", SearchOption.TopDirectoryOnly)) { BaseliningSummary part = RunUnder(subfolder); folderSummary.AddComponent(part); } // Look for logs and sort in Ordinal order if (Directory.EnumerateFiles(folderPath).Any()) { BaseliningSummary seriesSummary = RunSeries(folderPath); folderSummary.AddCounts(seriesSummary); } return(folderSummary); }