Type.Attributes Property
Gets the attributes associated with the Type.
Assembly: mscorlib (in mscorlib.dll)
abstract Attributes : TypeAttributes with get override Attributes : TypeAttributes with get
Property Value
Type: System.Reflection.TypeAttributesA TypeAttributes object representing the attribute set of the Type, unless the Type represents a generic type parameter, in which case the value is unspecified.
Implements
_Type.AttributesSome members of the TypeAttributes enumeration are masks that represent a group of values. Each group includes one member whose underlying value is zero. For example, the underlying value of the TypeAttributes.NotPublic member in the TypeAttributes.VisibilityMask group is zero, as is the TypeAttributes.AutoLayout member in the TypeAttributes.SequentialLayout group. Because of this, you must use the mask before testing for those values. The example provides an illustration.
Tip |
|---|
For most purposes, properties likeIsClass,IsAutoLayout, andIsSpecialName are easier to use than type attributes. |
If the current Type represents a constructed generic type, this property returns the attributes of the generic type definition. For example, the attributes returned for MyGenericClass<int> (MyGenericClass(Of Integer) in Visual Basic) are the attributes of MyGenericClass<T> (MyGenericClass(Of T) in Visual Basic).
If the current Type represents a generic type parameter — that is, if the IsGenericParameter property returns true — the TypeAttributes value returned by this property is unspecified.
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
