Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / October 2007

Tip: Looking for answers? Try searching our database.

Syntax Question (::)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mac McMicMac - 20 Oct 2007 18:42 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.