PostSharp//API Reference/Post­Sharp.​Aspects/Event­Level­Aspect/Compile­Time­Validate
Open sandboxFocus

Method CompileTimeValidate

CompileTimeValidate(EventInfo)

Method invoked at build time to ensure that the aspect has been applied to the right target.

Declaration
public virtual bool CompileTimeValidate(EventInfo targetEvent)
Parameters
Type Name Description
EventInfo targetEvent

Event to which the aspect has been applied

Returns
Type Description
Boolean

true if the aspect was applied to an acceptable event, otherwise false.

CompileTimeValidate(Object)

Method invoked at build time to ensure that the aspect has been applied to the right target.

Declaration
public sealed override bool CompileTimeValidate(object target)
Parameters
Type Name Description
Object target

Code element (Assembly, Type, FieldInfo, MethodBase, PropertyInfo, EventInfo, ParameterInfo, or LocationInfo) to which the aspect has been applied.

Returns
Type Description
Boolean

true if the aspect was applied to an acceptable target, otherwise false.

Overrides
Aspect.CompileTimeValidate(Object)
Implements
IValidableAnnotation.CompileTimeValidate(Object)