ReflectionSearch.GetCustomAttributesOnTarget<T> Method (Object, ReflectionSearchOptions) |
Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 6.10.10.0 (6.10.10.0)
public static IList<T> GetCustomAttributesOnTarget<T>( Object target, ReflectionSearchOptions options = ReflectionSearchOptions.IncludeDerivedTypes ) where T : Attribute
Parameters
- target
- Type: System.Object
Element of code (Type, MethodInfo, ...) whose custom attributes are requested. - options (Optional)
- Type: PostSharp.Reflection.ReflectionSearchOptions
IncludeDerivedTypes or None.
Type Parameters
- T
- Type of the custom attribute.
Return Value
Type: IList<T>The set of all custom attributes added, directly or indirectly, to target.
This method returns custom attributes from the internal annotation repository of PostSharp. This repository contains more than only custom attributes added in source code. For instance, if you use MulticastAttribute to add a custom attribute to several elements of code in a single line of code, this method will return one custom attribute instance for every target of the MulticastAttribute . |
This feature is available only at build time. |