Пример #1
0
        public static void GenerateXmlSnippets(SnippetDirectory[] snippetDirectories)
        {
            string destinationDirPath = snippetDirectories.First(f => f.Language == Language.Xml && f.HasTag(KnownTags.AutoGenerationDestination)).Path;

            Snippet[] snippets = XmlSnippetGenerator.GenerateSnippets(destinationDirPath, Language.Xml).ToArray();

            IOUtility.SaveSnippets(snippets, destinationDirPath);
        }
Пример #2
0
        public static void GenerateHtmlSnippets(SnippetDirectory[] snippetDirectories)
        {
            string sourceDirPath      = snippetDirectories.First(f => f.Language == Language.Html && f.HasTag(KnownTags.AutoGenerationSource)).Path;
            string destinationDirPath = snippetDirectories.First(f => f.Language == Language.Html && f.HasTag(KnownTags.AutoGenerationDestination)).Path;

            var snippets = new List <Snippet>();

            snippets.AddRange(XmlSnippetGenerator.GenerateSnippets(destinationDirPath, Language.Html));
            snippets.AddRange(HtmlSnippetGenerator.GenerateSnippets(sourceDirPath));

            IOUtility.SaveSnippets(snippets.ToArray(), destinationDirPath);
        }
Пример #3
0
        public static void GenerateXamlSnippets(SnippetDirectory[] snippetDirectories)
        {
            IEnumerable <SnippetDirectory> directories = snippetDirectories
                                                         .Where(f => f.Language == Language.Xaml);

            string sourceDirPath      = directories.First(f => f.HasTag(KnownTags.AutoGenerationSource)).Path;
            string destinationDirPath = directories.First(f => f.HasTag(KnownTags.AutoGenerationDestination)).Path;

            var snippets = new List <Snippet>();

            snippets.AddRange(XmlSnippetGenerator.GenerateSnippets(destinationDirPath, Language.Xaml));

            var generator = new XamlSnippetGenerator();

            snippets.AddRange(generator.GenerateSnippets(sourceDirPath));

            IOUtility.SaveSnippets(snippets.ToArray(), destinationDirPath);
        }