O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Visibility

Namespaces don’t have a notion of visibility. In C# terms, you could say namespaces are implicitly declared as public because they can’t be used to restrict visibility of the types defined within them. In other words, it’s up to the types (and members therein) to declare their visibility.

Figure 24.7 illustrates how namespaces are totally compiled away into longer type names, which is what the CLR sees. In other words, there’s no place in an assembly to put metadata (such as visibility) on a namespace declaration. What tools like ILDASM and .NET Reflector do is show types in their namespaces by analyzing the dot-separated pattern followed for their naming. The fact there’s no such thing as metadata associated with a namespace is reflected ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required