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, “Object-Oriented Programming.”

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 ...

Get C# 4.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.