PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingBackground­AttributeCompile­Time­Validate
Open sandboxFocus

BackgroundAttribute.CompileTimeValidate Method

CompileTimeValidate(MethodBase)

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

Declaration
public override bool CompileTimeValidate(MethodBase method)
Parameters
Type Name Description
System.Reflection.MethodBase method

Method to which the aspect has been applied

Returns
Type Description
Boolean

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

Overrides
MethodLevelAspect.CompileTimeValidate(MethodBase)
Remarks

The implementation of this method is expected to emit an error message (see MessageSource) or an exception in case of error. Returning false without emitting an error message or exception causes the aspect to be silently ignored.

See Also