I am working on a project that will be heavily obscured by the template, but the generated templates may also work well in future projects such as CodeSnippets for Visual Studio.
So, I was wondering, is there a way to access Visual Studio's boot system, parse and display CodeSnippets in any way, form or form?
For example, it would be really easy to do something like this:
var snippet = LoadSnippet("~/path/to/code.snippet"); if (snippet != null) { snippet.TryReplace("$token$", "Some Value"); // and then do something with snippet.ToString(), or... Console.WriteLine(snippet.GetCSharpString()); }
I know that I can just download .snippet files in XML format and manipulate them manually, but from the point of view of using other things, such as filling in the token defaults, executing functions to replace tokens, or controlling editable from tokens in the fragment file, which is more work than I want to duplicate if I do not need.
Ideas?
Thanks!
source share