Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a situation where I have several VB.NET Modules in the same Logical-Module of a large application.

I would like the update function of each module to be public, but I would like users to be forced to qualify the function call with the module name.

ModuleName.Update()

instead of

Update()

Is this possible?

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
696 views
Welcome To Ask or Share your Answers For Others

1 Answer

No.

The VB.NET specifications automatically use Type Promotion to allow this behavior to occur. The only way to avoid this is to have a type at the namespace that has the same name (Update) which would prevent (defeat) the type promotion provided in VB.NET.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...