|  | CustomAttributeProviderExtensionsGetCustomAttributesT Method | 
Namespace: TomsToolbox.EssentialsAssembly: TomsToolbox.Essentials (in TomsToolbox.Essentials.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
 Syntax
Syntaxpublic static IEnumerable<T> GetCustomAttributes<T>(
	this ICustomAttributeProvider self,
	bool inherit
)
<ExtensionAttribute>
Public Shared Function GetCustomAttributes(Of T) ( 
	self As ICustomAttributeProvider,
	inherit As Boolean
) As IEnumerable(Of T)
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
IEnumerableTAn 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
Exceptions| Exception | Condition | 
|---|
| TypeLoadException | A custom attribute type cannot be loaded | 
| InvalidOperationException | This 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
See Also