Photon Fusion 2.1.1

ReflectionUtils Class Reference

Provides utility methods for reflection. More...

Static Public Member Functions

static T GetCustomAttributeOrThrow< T > (this MemberInfo member, bool inherit)
 Retrieves a custom attribute of type T from the provided member.

Detailed Description

Provides utility methods for reflection.

Member Function Documentation

◆ GetCustomAttributeOrThrow< T >()

T GetCustomAttributeOrThrow< T > ( this MemberInfo member,
bool inherit )
static

Retrieves a custom attribute of type T from the provided member.

Template Parameters
TThe type of the attribute to retrieve. Must be a subclass of Attribute.
Parameters
memberThe member to retrieve the attribute from.
inheritSpecifies whether to search this member's inheritance chain to find the attributes.
Returns
The custom attribute of type T.
Exceptions
ArgumentOutOfRangeExceptionThrown when the provided member does not have an attribute of type T.
InvalidOperationExceptionThrown when the provided member has more than one attribute of type T.
Type Constraints
T :Attribute