Table of Contents

Method GetCustomAttributes

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

GetCustomAttributes<T>(Type, bool)

Gets all attributes of a specific type on the specified type.

public static T[] GetCustomAttributes<T>(this Type type, bool inherit = true) where T : Attribute

Parameters

type Type

The type to get attributes from

inherit bool

true if attributes should be inherited from base types

Returns

T[]

An array of attributes applied to this type, or an empty array if no attributes are found.

Type Parameters

T

The type of attribute to get

GetCustomAttributes<T>(MemberInfo, bool)

Gets all attributes of a specific type on the specified member.

public static T[] GetCustomAttributes<T>(this MemberInfo member, bool inherit = true) where T : Attribute

Parameters

member MemberInfo

The member to get attributes from

inherit bool

true if attributes should be inherited from base types

Returns

T[]

An array of attributes applied to this member, or an empty array if no attributes are found.

Type Parameters

T

The type of attribute to get