System.Reflection.ICustomAttributeProvider.GetCustomAttributes Method

Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes.

Syntax

public object[] GetCustomAttributes (bool inherit)

Parameters

inherit
When true, look up the hierarchy chain for the inherited custom attribute.

Returns

An array of Objects representing custom attributes, or an empty array.

Remarks

Calling ICustomAttributeProvider.GetCustomAttributes(Type, bool) on System.Reflection.PropertyInfo or System.Reflection.EventInfo when the inherit parameter of GetCustomAttributes is true does not walk the type hierarchy. Use Attribute to inherit custom attributes.

This method returns custom attributes defined directly on a non-inherited member only.

Requirements

Namespace: System.Reflection
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0