Export (0) Print
Expand All

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
[C#]
public abstract object[] GetCustomAttributes(
 Type attributeType,
 bool inherit
);
[C++]
public: virtual Object* GetCustomAttributes(
 Type* attributeType,
 bool inherit
)  __gc[] = 0;
[JScript]
public abstract function GetCustomAttributes(
   attributeType : Type,
 inherit : Boolean
) : Object[];

Parameters

attributeType
The type of attribute to search for. Only attributes that are assignable to this type are returned.
inherit
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.

Implements

ICustomAttributeProvider.GetCustomAttributes

Exceptions

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

Requirements

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

Show:
© 2014 Microsoft