Share via


Utility.GetCustomAttributes(Type, Type, Boolean) Method

Definition

When overridden in a derived class, returns an array of custom attributes applied to this member and identified by System.Type.

public static System.Collections.Generic.IEnumerable<object> GetCustomAttributes (Type type, Type attributeType, bool inherit);
static member GetCustomAttributes : Type * Type * bool -> seq<obj>
Public Shared Function GetCustomAttributes (type As Type, attributeType As Type, inherit As Boolean) As IEnumerable(Of Object)

Parameters

type
Type

The type to query custom attributes on.

attributeType
Type

The type of attribute to search for. Only attributes that are assignable to this type are returned.

inherit
Boolean

true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events; see Remarks.

Returns

An IEnumerable<T> of custom attributes applied to this member, or an array with zero elements if no attributes assignable to attributeType have been applied.

Applies to