ReflectionSearch.HasCustomAttribute Method |
Namespace: PostSharp.Reflection
Assembly: PostSharp (in PostSharp.dll) Version: 6.9.11.0 (6.9.11.0)
public static bool HasCustomAttribute( Object target, Type type, bool inherit = false )
Parameters
- target
- Type: System.Object
Element of code (Type, MethodInfo, ...) whose custom attributes are requested. - type
- Type: System.Type
The type of custom attributes. - inherit (Optional)
- Type: System.Boolean
true to consider custom attributes derived from type, false to consider only custom attributes strictly of type type.
Return Value
Type: BooleanTrue if type has a custom attribute of type type, otherwise false.