public ReadSnippets ReadSnippets(string directory) { var snippetExtractor = FileSnippetExtractor.BuildShared(); var packages = ReadSnippets(directory, snippetExtractor).ToList(); return(new ReadSnippets(packages)); }
List <Snippet> GetShared(string directory) { var sharedDirectory = Path.Combine(directory, "Shared"); if (Directory.Exists(sharedDirectory)) { var snippetExtractor = FileSnippetExtractor.BuildShared(); return(ReadSnippets(sharedDirectory, snippetExtractor).ToList()); } var allPath = Path.Combine(directory, Path.GetFileName(directory) + "_All"); if (Directory.Exists(allPath)) { var snippetExtractor = FileSnippetExtractor.BuildShared(); return(ReadSnippets(allPath, snippetExtractor).ToList()); } return(new List <Snippet>()); }