PostSharp//API Reference/Post­Sharp.​Patterns.​Contracts/String­Length­Attribute/Validate­Value­Dynamic
Open sandboxFocus

Method ValidateValueDynamic

ValidateValueDynamic(Object, String, LocationKind, LocationValidationContext)

Validates a weakly-typed (boxed) value, typically the value of a dependency property or an attached property.

Declaration
public override Exception ValidateValueDynamic(object value, string locationName, LocationKind locationKind, LocationValidationContext context)
Parameters
Type Name Description
Object value

Value.

String locationName

The name of the property.

LocationKind locationKind

The kind of location (typically a Property).

LocationValidationContext context

Why or when the value is being validated.

Returns
Type Description
Exception

An Exception if the value is invalid, or null if the value is valid.

Overrides
LocationContractAttribute.ValidateValueDynamic(Object, String, LocationKind, LocationValidationContext)