You can use the public, protected, internal, or private modifier to specify one of the following declared access levels for members.
Http://keleyi.com/a/bjad/3ccfqh95.htm
Declared accessibility |
Description |
Public |
Access is unrestricted. |
Protected |
Access is limited to include classes or types derived from include classes. |
Internal |
Access is limited to the current Assembly. |
Protected internal |
Access is limited to the current Assembly or type derived from the include class. |
Private |
Access is limited to the include type. |
One member or type can only have one access modifier, except when the protectedinternal combination is used.
Access modifiers are not allowed in the namespace. The namespace has no access restrictions.
Only the accessibility of some declarations is allowed according to the context in which the member declaration appears. If no access modifier is specified in the member declaration, the default accessibility is used.
The accessibility of top-level types not nested in other types can only be internal or public. The default accessibility of these types is internal.
The nested type is a member of another type, which can have the accessibility declared as shown in the following table.
Belong |
Default accessible members |
The declared accessibility allowed by this Member |
Enum |
Public |
None |
Class |
Private |
Public Protected Internal Private Protected internal |
Interface |
Public |
None |
Struct |
Private |
Public Internal Private |
The accessibility of the nested type depends on its accessible domain, which is determined by the declared member accessibility and directly including accessible domains. However, the accessible domains of the nested type cannot exceed the accessible domains of the contained type.