Automatically importing an assembly

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by Steven Nielson - Software Developer Lead, Microfocus
Avatar
I am using the VB.Net Add-on with the SyntaxEditor. I want to automatically import an assembly that my end users will always use, but I would rather not have the Imports statement in the editor. Is there a way to add the namespaces within the assembly to the Intellisense so that their methods and properties will show at the top level?
For example:

Without importing end user code would look like this:
Dim x as Foo.Bar.MyAssembly.MyType

With importing:
Imports Foo.Bar.MyAssembly
Dim x as MyType

What I would like to achieve:
Dim x as MyType

Thanks for any direction you can provide.

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Steven,

Check out the Code Fragments QuickStart we have. What you can do is essentially insert your import statements in the Document.HeaderText property. Then semantic parsing will merge that with the normal visible document text when parsing runs. Make sure you put a line feed at the end of your HeaderText though since VB requires that as a statement delimiter.


Actipro Software Support

Posted 14 years ago by Steven Nielson - Software Developer Lead, Microfocus
Avatar
That does exactly what I want. Thank you for your speedy response.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.