Extension methods for System.Reflection.ICustomAttributeProvider.
Namespace: Cadenza.Reflection
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
See Also: Inherited members from object.
⊟ Public Methods
staticGetCustomAttribute<TAttribute> (this System.Reflection.ICustomAttributeProvider) : TAttribute Retrieves a custom attribute of type TAttribute. staticGetCustomAttributes<TAttribute> (this System.Reflection.ICustomAttributeProvider) : TAttribute[] Retrieves all custom attributes of type TAttribute.
⊟ GetCustomAttribute<TAttribute> Generic Method
Retrieves a custom attribute of type TAttribute.
public static TAttribute GetCustomAttribute<TAttribute> (this System.Reflection.ICustomAttributeProvider self)
where TAttribute : Attribute⊟ Type Parameters
- TAttribute
- The type of the custom attribute to return.
⊟ Parameters
- self
- A System.Reflection.ICustomAttributeProvider from which to retrieve a custom attribute of type TAttribute.
⊟ Returns
Returns the first custom attribute of type TAttribute or null if no type parameters of type TAttribute are available.⊟ Exceptions
Type Reason ArgumentNullException self is null. ⊟ Remarks
C# Example FooAttribute foo = typeof (Bar).GetCustomAttribute<FooAttribute> ();⊟ Requirements
Namespace: Cadenza.Reflection
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ GetCustomAttributes<TAttribute> Generic Method
Retrieves all custom attributes of type TAttribute.
public static TAttribute[] GetCustomAttributes<TAttribute> (this System.Reflection.ICustomAttributeProvider self)
where TAttribute : Attribute⊟ Type Parameters
- TAttribute
- The type of the custom attribute to return.
⊟ Parameters
- self
- A System.Reflection.ICustomAttributeProvider from which to retrieve custom attributes of type TAttribute.
⊟ Returns
Returns all custom attributes of type TAttribute or an empty array if no type parameters of type TAttribute are available.⊟ Exceptions
Type Reason ArgumentNullException self is null. ⊟ Remarks
C# Example var attributes = typeof (Bar).GetCustomAttributes<FooAttribute> ();⊟ Requirements
Namespace: Cadenza.Reflection
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0