I would like to create some snippets from a resource file so this is what I attempt to do:
Private Sub AddCodeSnippets()
Dim Document As New Xml.XmlDocument
Dim Xml As String = My.Resources.CodeSnippets
Document.LoadXml(Xml)
Dim Snippets() As CodeSnippet = CodeSnippet.LoadFromXml(Document)
Dim Folder As New CodeSnippetFolder("")
For Each Snippet As CodeSnippet In Snippets
Folder.CodeSnippets.Add(Snippet)
Next
DotNetResolver.CodeSnippetFolders.Add(Folder)
End Sub
In the Editor I add a Button to show the snippets and they do show, however when I select the snippet I get the following:
"A header-only code snippet 'For' was activated but no source file was specified. The code snippet cannot be activated unless its SourceFile property is set."
Is my approach above incorrect? I didn't specifiy a folder name in the constructor for the CodeSnippetFolder because it's a resource file.
Private Sub AddCodeSnippets()
Dim Document As New Xml.XmlDocument
Dim Xml As String = My.Resources.CodeSnippets
Document.LoadXml(Xml)
Dim Snippets() As CodeSnippet = CodeSnippet.LoadFromXml(Document)
Dim Folder As New CodeSnippetFolder("")
For Each Snippet As CodeSnippet In Snippets
Folder.CodeSnippets.Add(Snippet)
Next
DotNetResolver.CodeSnippetFolders.Add(Folder)
End Sub
In the Editor I add a Button to show the snippets and they do show, however when I select the snippet I get the following:
"A header-only code snippet 'For' was activated but no source file was specified. The code snippet cannot be activated unless its SourceFile property is set."
Is my approach above incorrect? I didn't specifiy a folder name in the constructor for the CodeSnippetFolder because it's a resource file.