Snippets from Resource File

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Sean Miller
Version: 4.0.0280
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

Dim Snippets() As CodeSnippet = CodeSnippet.LoadFromXml(Document)
Dim Folder As New CodeSnippetFolder("")

For Each Snippet As CodeSnippet In Snippets


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.

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA

You'd have to set CodeSnippet.IsHeaderOnly = false, and then in the CodeSnippetActivating event, be sure to set e.CodeText from your resource.

Actipro Software Support

The latest build of this product (v21.1.0) was released 18 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.