This questions is for VBers, it’s irrelevant in C#.
In VB, when you create a module, all it’s functions and members are available in the scope without need to type the module name, just like all the VB functions (Rnd, Mid, IIf etc.).
I want to create a module but I should have to explicitly write it’s name to access it’s members, i.e. it shouldn’t be loaded to the scope like a namespace.
Update
For example, I have a Module of extension methods, I don’t want all it’s members to show up on the scope and in the intellisense.
I want it to be available only by instance.ExtensionMethod().
Any ideas?
If you create a Class instead of a Module then VB.NET will insist you use the class name. For example:
It is hardly necessary, but you can prevent anyone from inheriting this class by adding a private constructor.
Update
To avoid extension methods from polluting the global namespace in IntelliSense. I found a rather unexpected workaround for this: