Open sandboxFocus

Method ValidateTargetParameter

ValidateTargetParameter(ParameterInfo)

Validates the parameter to which the current constraint has been applied. A typical use of this method is to validate the parameter type. Overriding implementations should call the base implementation.

Declaration
protected virtual bool ValidateTargetParameter(ParameterInfo parameter)
Parameters
Type Name Description
ParameterInfo parameter

The parameter to which the custom attribute has been applied.

Returns
Type Description
bool

true if the current constraint can legally be applied to parameter, false otherwise. No error message is emitted if the method returns false. The method should emit its own error message.