-
Notifications
You must be signed in to change notification settings - Fork 36
M_CodeJam_Reflection_ReflectionExtensions_GetMetadataAttributes__1_1
Performs search for metadata attributes. If the thisLevelOnly is true
, the search is performed in the following order: * member attributes, base implementation attributes (if the attributeProvider is member of the type) * type attributes, base type attributes (if the attributeProvider is type or member of the type) * container type attributes (if the type is nested type) * assembly attributes.
Namespace: CodeJam.Reflection
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static IEnumerable<TAttribute> GetMetadataAttributes<TAttribute>(
this ICustomAttributeProvider attributeProvider,
bool thisLevelOnly
)
where TAttribute : class
VB
<ExtensionAttribute>
Public Shared Function GetMetadataAttributes(Of TAttribute As Class) (
attributeProvider As ICustomAttributeProvider,
thisLevelOnly As Boolean
) As IEnumerable(Of TAttribute)
F#
[<ExtensionAttribute>]
static member GetMetadataAttributes :
attributeProvider : ICustomAttributeProvider *
thisLevelOnly : bool -> IEnumerable<'TAttribute> when 'TAttribute : not struct
- attributeProvider
- Type: System.Reflection.ICustomAttributeProvider
Metadata attribute source. - thisLevelOnly
- Type: System.Boolean
Do not check containers for the attributes.
- TAttribute
- Type of the attribute or type of the interface implemented by the attributes.
Type: IEnumerable(TAttribute)
Metadata attributes.
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).
Search logic for each level matches to the GetCustomAttributes(MemberInfo, Type, Boolean) method (inherit = true
). including checks of AttributeUsageAttribute. Ordering of attributes at each level is undefined and depends on runtime implementation.
ReflectionExtensions Class
GetMetadataAttributes Overload
CodeJam.Reflection Namespace