Esempio n. 1
0
        public ReadSnippets ReadSnippets(string directory)
        {
            var snippetExtractor = FileSnippetExtractor.BuildShared();
            var packages         = ReadSnippets(directory, snippetExtractor).ToList();

            return(new ReadSnippets(packages));
        }
Esempio n. 2
0
        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>());
        }