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); }
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(")); }
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); }