Esempio n. 1
0
        public void GenerateXmlFromCSharpSnippet()
        {
            var snippet = VisualStudioSnippet.ParseFromFile(
                @"C:\Users\rstrahl\Documents\Visual Studio 2017\Code Snippets\Visual C#\My Code Snippets\proIPC.snippet");


            var template = JetBrainsLiveTemplate.FromVisualStudioCodeSnippet(snippet);
            var xml      = template.ToXml();

            Console.WriteLine(xml);
        }
Esempio n. 2
0
        public void ConvertVsSnippetToJbTemplate()
        {
            var snippet = VisualStudioSnippet.ParseFromFile(
                @"C:\Users\rstrahl\Documents\Visual Studio 2017\Code Snippets\Visual C#\My Code Snippets\proIPC.snippet");

            var template = JetBrainsLiveTemplate.FromVisualStudioCodeSnippet(snippet);

            Assert.IsNotNull(template);
            Assert.IsTrue(template.Shortcut.Equals("proipc", StringComparison.InvariantCulture));
            Assert.IsTrue(template.Code.Contains("OnPropertyChanged("));
        }
Esempio n. 3
0
        public void AddToSettingsFromCSharpSnippet()
        {
            var snippet = VisualStudioSnippet.ParseFromFile(
                @"C:\Users\rstrahl\Documents\Visual Studio 2017\Code Snippets\Visual C#\My Code Snippets\proIPC.snippet");


            var template = JetBrainsLiveTemplate.FromVisualStudioCodeSnippet(snippet);

            bool result = template.AddCSharpTemplate();

            Assert.IsTrue(result);
        }