So System.Type
has an instance method called Attributes.
public TypeAttributes Attributes { get; }
which returns an enum
of type TypeAttributes
. Here are some members of this enum:
public enum TypeAttributes {
AnsiClass = 0,
Class = 0,
AutoLayout = 0,
NotPublic = 0,
Public = 1,
NestedPublic = 2,
NestedPrivate = 3,
NestedFamily = 4,
NestedAssembly = 5,
NestedFamANDAssem = 6,
VisibilityMask = 7,
NestedFamORAssem = 7,
SequentialLayout = 8,
ExplicitLayout = 16,
LayoutMask = 24,
...
}
But on the other hand, Type
class has provides too many properties for most of the stuff appear in this enum:
IsPublic
IsClass
IsNestedFamANDAssem
IsAutoLayout
...
So what exactly Type.Attributes
is for? I guess it is not a bitmasked value, since it is an enum and it returns only a single member of enum. And this is not a static property on Type
class,so what exactly does it do?