質問

Been having this issue for a while now, tried to google it, but don't now really how to ask google this properly, so will try it here.

I made my own dll's, each containing different vb.net modules, each with different functions. So for example I have a vb.net module called 'Helper', with the functions 'helper1', 'helper2', 'helper3'..

So I want to call it in a website like 'Helperdll.Helper.helper1()'. Problem is that the intellisense already shows the functionames before I typed the modulename. So it's possible for me to call 'Helperdll.helper1(). And I want this to dissapear.

I already tried to add this just before the function. This hides indeed the functionname for the intellisense, but is not really what I'm looking for. :

'<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Advanced)>' 

So my question: Isn't it possible to add a rule like this one above on top of the module (so not for every function seperatly) or fix something in the properties of the dll which will hide the functionnames until the right module has been called?

役に立ちましたか?

解決

That is a feature of VB.NET's Modules, it's called Type Promotion. There is no way to deactivate this behaviour.

Check if you really need a Module or if a class with Shared members would serve the same purpose for you.

Just saw that there already is a question like this: VB.NET Module - Can I force the use of <Module_Name>.Public_Member_Name when accessing pub. Members?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top