> In VB.NET you can declare something like following..
>
[quoted text clipped - 8 lines]
>
> Any help would be appreciated.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
This is my biggest dislike of C# and Java vs C++, VB and most anything else.
I don't want to see global variable added to C#. However I really really
really would love something in the language that lets me treat static members
and functions of a class as if they were in the current scope.
This is purely for reason of saving the amount of typing I do (both speed of
development, and readability). For example, I want to just type:
x = DoThis(n);
Instead of:
x = MyLibrary.DoThis(n);
If I have a lot of code and frequently use utility functions accross my app,
this really is a lot of typing I have to do in C# that I would not have in
C++. Yes, I know I can just add a function to the class I am working on:
static int DoThis(int x)
{
return MyLibrary.DoThis();
}
but it is a pain to do this all the time for every class and library
function I use often.
How about a feature like putting
using globalscope = MyLibary;
at the top of my class?
> > In VB.NET you can declare something like following..
> >
[quoted text clipped - 17 lines]
> this though - constants, and public static properties are fine, but
> variables themselves don't give you much control.
Jon Skeet [C# MVP] - 30 Sep 2005 22:24 GMT
<=?Utf-8?B?QnJhZCBCZWxsb21v?= <Brad
Bellomo@discussions.microsoft.com>> wrote:
> This is my biggest dislike of C# and Java vs C++, VB and most anything else.
Well, Java 1.5 has import static which does exactly what you're after.
In my experience it's handy in certain situations (particularly for
enums), but shouldn't be used particularly often.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too