參考自Default visibility for C# classes and members (fields, methods, etc)?
Classes and structs that are declared directly within a namespace (in other words, that are not nested within other classes or structs) can be either public or internal. Internal is the default if no access modifier is specified.
直接聲明在命名空間下的類和結構體,默認是internal的。
The access level for class members and struct members, including nested classes and structs, is private by default.
類和結構體的成員,包括內嵌的類和結構體,默認是private的
interfaces default to internal access.
接口默認是internal的
Delegates behave like classes and structs. By default, they have internal access when declared directly within a namespace, and private access when nested.
委托和類以及結構體類似。直接聲明在命名空間下的訪問權限默認是internal的。如果內嵌的話,就是private的。
Top-level types, which are not nested in other types, can only have internal or public accessibility. The default accessibility for these types is internal.
總結,最高等級的類型(沒有內嵌在其他類型中),只能有internal和public的訪問權限。這些類型默認的訪問權限是internal
然而對於內嵌的類型來說
And for nested types:
Members of Default member accessibility
---------- ----------------------------
enum public //enum的成員是public的訪問權限
class private //類的成員,默認是private的訪問權限
interface public //接口的成員,默認是public的訪問權限
struct private //結構體的成員,和class類似,默認的訪問權限也是private的