I was just going through Resources.Designer.cs and saw this code:
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
What is the meaning of the two colons between 'global' and 'System' in the
second line? (... global::System.Resources...)
I understand a single colon as indicating inheritance in a class
declaration... but what about two colons in a variable declaration?
Thanks.
pvdg42 - 20 Oct 2007 18:58 GMT
>I was just going through Resources.Designer.cs and saw this code:
>
[quoted text clipped - 9 lines]
>
> Thanks.
Here you go...
http://msdn2.microsoft.com/en-us/library/htccxtad(VS.80).aspx
Alun Harford - 20 Oct 2007 20:20 GMT
> I was just going through Resources.Designer.cs and saw this code:
>
[quoted text clipped - 6 lines]
> I understand a single colon as indicating inheritance in a class
> declaration... but what about two colons in a variable declaration?
Consider the situation where you have two different types with the same
name and namespace, located in two different dlls. You need to be able
to define which of those types you want to refer to.
If you use a compiler flag when you include the dll, you can give a dll
an alias (the default is 'global').
Then you can use alias::type to refer to that type.
Alun Harford