Visibility

To limit access to members, accessibility modifiers exist. This functionality is intertwined with support for object-oriented programming, as you will see in Chapter 14.

Type Visibility

Visibility exists not only on the member level but also on the type level. Let’s take a look at that first. A type’s visibility determines from where it can be used, in particular whether other assemblies can access it. Assemblies can be seen roughly as containers for types (as detailed in Chapter 25, “Assemblies and Application Domains”). For example, the System.String type lives in an assembly called mscorlib.dll and has been declared as “public,” which means other assemblies can access it.

If you were to take a look at mscorlib.dll in tools like ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.