J
Jeff Johnson [MVP: VB]
What do I need to do to figure out if a class, enum, etc. is public,
private, protected, Friend, etc.?
private, protected, Friend, etc.?
Jeff Johnson said:What do I need to do to figure out if a class, enum, etc. is public,
private, protected, Friend, etc.?
Use Type.GetAttributeFlagsImpl - look at the TypeAttributes enumeration
for more detail.
Wow. That was not intuitive. Thanks.
Mattias Sjögren said:Well it's not the only way, you can also use the Is<AccessLevel>
(IsPublic, IsNotPublic, IsNestedFamily and so on) on the Type.
Unfortunately that doesn't distinguish (for non-nested types) between
internal, protected and private, as far as I can see.
Mattias Sjögren said:There are only two levels that can be used for non-nested types,
public (IsPublic) or not (IsNotPublic). The non-public level is called
private in ILAsm, internal in C# and Friend in VB.NET. Protected
doesn't make sense if the type isn't nested.