Nested Types (C# Programming Guide)
A type defined within a class or struct is called a nested type. For example:
Regardless of whether the outer type is a class or a struct, nested types default to private, but can be made public, protected internal, protected, internal, or private. In the previous example, Nested is inaccessible to external types, but can be made public like this:
The nested, or inner type can access the containing, or outer type. To access the containing type, pass it as a constructor to the nested type. For example:
A nested type has access to all of the members that are accessible to its containing type. It can access private and protected members of the containing type, including any inherited protected members.
In the previous declaration, the full name of class Nested is Container.Nested. This is the name used to create a new instance of the nested class, as follows:
