I really like the work Visual Studio saves you from having to do, especially when implementing from an interface; gives you the option to populate your class with the members necessary to implement the interface. Today I ran into something I haven't seen
before.
<code>
public
{
get { throw
new global :: System.NotImplementedException(); }
}
</code>
I searched the msdn, specifically the C# Language reference but didn't see any keyword for global. Can someone explain to me what the get accessor is actually throwing. Also, I've only seen the double colons '::' in c code and didn't realize that was available
in C#, however I have no idea what the hell it does.
-
-
I don't know who invented this keyword, but global:: returns the Global Namespace root. Try to type it in Visual Studio. Intellisense will show you all classes that aren't in a namespace and all Root-Namespaces, such as System., Microsoft. etc.
Probably it comes from VC++ - but I don't know it exactly.
Ps. Throws NotImplementedException in the System-namespace
-
throw new global :: System.NotImplementedException();
--> global probably is created by 3rd party
--> Using :: should be in C++ right?
(correct me if i am wrong) -
The global keyword and the :: accessor are new features of the new C# 2.0 language which will be released with .NET Framework 2.0 and Visual Studio 2005.
Don't try to compile C# 2.0 code with a C# 1.0 compiler (from Visual Studio .NET 2002 or 2003). -
I think it is time for me to learn C# 2.0 features. Thanks for the tips SorinD

Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.