Anvil
Anvil.API.ReflectionExtensions Class Reference

Static Public Member Functions

static T[] GetCustomAttributes< T > (this MemberInfo member, bool inherit=true)
 Gets all attributes of a specific type on the specified member. More...
 
static T[] GetCustomAttributes< T > (this Type type, bool inherit=true)
 Gets all attributes of a specific type on the specified type. More...
 
static string GetFullName (this MemberInfo member)
 Gets the full name of the specified type member. More...
 
static ? T SafeGetCustomAttribute< T > (this MemberInfo memberInfo, bool inherit=true)
 

Member Function Documentation

◆ GetCustomAttributes< T >() [1/2]

static T [] Anvil.API.ReflectionExtensions.GetCustomAttributes< T > ( this MemberInfo  member,
bool  inherit = true 
)
inlinestatic

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

Parameters
memberThe member to get attributes from
inherittrue if attributes should be inherited from base types
Template Parameters
TThe type of attribute to get
Returns
An array of attributes applied to this member, or an empty array if no attributes are found.
Type Constraints
T :Attribute 

◆ GetCustomAttributes< T >() [2/2]

static T [] Anvil.API.ReflectionExtensions.GetCustomAttributes< T > ( this Type  type,
bool  inherit = true 
)
inlinestatic

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

Parameters
typeThe type to get attributes from
inherittrue if attributes should be inherited from base types
Template Parameters
TThe type of attribute to get
Returns
An array of attributes applied to this type, or an empty array if no attributes are found.
Type Constraints
T :Attribute 

◆ GetFullName()

static string Anvil.API.ReflectionExtensions.GetFullName ( this MemberInfo  member)
inlinestatic

Gets the full name of the specified type member.

Parameters
memberThe member to get the name of.
Returns
The full name of the member, prefixed with the namespace and enclosing type (if valid). If the member is not declared in a type, returns the member name.

The documentation for this class was generated from the following file: