Open sandboxFocus

Method CompileTimeValidate

CompileTimeValidate(FieldInfo)

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

Declaration
public virtual bool CompileTimeValidate(FieldInfo field)
Parameters
Type Name Description
FieldInfo field

Field to which the aspect has been applied

Returns
Type Description
bool

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

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

CompileTimeValidate(object)

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

Declaration
public override sealed 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
bool

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

Overrides
Implements
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