Posted 15 years ago by GeorgeNY - CTO, RatchetSoft, LLC
Avatar
I am creating a CodeSnippet and it requires an additional C# using statement to compile clean. I have tried adding it to CodeSnippet.Imports but it is not added to my code when the snippet adds the code. Is there a way to have the "using MyNamespace; " added to the top of the code when the snippet fires?

George P Weihs

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi George,

You'd probably have to handle an event like SyntaxEditor.CodeSnippetActivating and in that do your determination as to whether an import needs to be added. If so then add it yourself programmatically. There isn't anything built in to do it now.


Actipro Software Support

The latest build of this product (v24.1.0) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.