The declared accessibility of a member can be one of the following:
public
modifier in the member declaration. The intuitive meaning of public
is "access not limited".protected
and an internal
modifier in the member declaration. The intuitive meaning of protected
internal
is "access limited to this project or types derived from the containing class".protected
modifier in the member declaration. The intuitive meaning of protected
is "access limited to the containing class or types derived from the containing class".internal
modifier in the member declaration. The intuitive meaning of internal
is "access limited to this project".private
modifier in the member declaration. The intuitive meaning of private
is "access limited to the containing type".Depending on the context in which a member declaration takes place, only certain types of declared accessibility are permitted. Furthermore, when a member declaration does not include any access modifiers, the context in which the declaration takes place determines the default declared accessibility.
public
declared accessibility. No access modifiers are allowed on namespace declarations.public
or internal
declared accessibility and default to internal
declared accessibility.private
declared accessibility. (Note that a type declared as a member of a class can have any of the five types of declared accessibility, whereas a type declared as a member of a namespace can have only public
or internal
declared accessibility.)public
, internal
, or private
declared accessibility and default to private
declared accessibility. Struct members cannot have protected
or protected
internal
declared accessibility.public
declared accessibility. No access modifiers are allowed on interface member declarations.public
declared accessibility. No access modifiers are allowed on enumeration member declarations.