This documentation is archived and is not being maintained.

MemberInfo.GetCustomAttributes Method (Type, Boolean)

.NET Framework 1.1

When overridden in a derived class, returns an array of custom attributes identified by Type.

[Visual Basic]
Overloads Public MustOverride Function GetCustomAttributes( _
   ByVal attributeType As Type, _
   ByVal inherit As Boolean _
) As Object() Implements ICustomAttributeProvider.GetCustomAttributes
public abstract object[] GetCustomAttributes(
 Type attributeType,
 bool inherit
public: virtual Object* GetCustomAttributes(
 Type* attributeType,
 bool inherit
)  __gc[] = 0;
public abstract function GetCustomAttributes(
   attributeType : Type,
 inherit : Boolean
) : Object[];


The type of attribute to search for. Only attributes that are assignable to this type are returned.
Specifies whether to search this member's inheritance chain to find the attributes.

Return Value

An array of custom attributes defined on this reflected member, or an array with zero (0) elements if no attributes are defined.




Exception Type Condition
TypeLoadException If the custom attribute type can not be loaded.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

MemberInfo Class | MemberInfo Members | System.Reflection Namespace | MemberInfo.GetCustomAttributes Overload List