Click or drag to resize

CustomAttributeProviderExtensionsGetCustomAttributesT Method

Returns a list of custom attributes identified by the type. GetCustomAttributes(Type, Boolean)

Namespace: TomsToolbox.Essentials
Assembly: TomsToolbox.Essentials (in TomsToolbox.Essentials.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax
public static IEnumerable<T> GetCustomAttributes<T>(
	this ICustomAttributeProvider self,
	bool inherit
)

Parameters

self  ICustomAttributeProvider
The member info of the object to evaluate.
inherit  Boolean
Specifies whether to search this member's inheritance chain to find the attributes.

Type Parameters

T
The type of attributes to return.

Return Value

IEnumerableT
An array of custom attributes applied to this member, or an array with zero (0) elements if no attributes have been applied.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ICustomAttributeProvider. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
TypeLoadExceptionA custom attribute type cannot be loaded
InvalidOperationExceptionThis member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context.
See Also