PostSharp6.2/API Reference/Post­Sharp.​Patterns.​Contracts Namespace/String­Length­Attribute Class/String­Length­Attribute Methods/String­Length­Attribute.​Validate­Value­Dynamic Method

StringLengthAttribute.ValidateValueDynamic Method

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

Namespace:  PostSharp.Patterns.Contracts
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.2.8.0 (6.2.8.0)
Syntax
C#
public override Exception ValidateValueDynamic(
	Object value,
	string locationName,
	LocationKind locationKind,
	LocationValidationContext context
)

Parameters

value
Type: System.Object
Value.
locationName
Type: System.String
The name of the property.
locationKind
Type: PostSharp.Reflection.LocationKind
The kind of location (typically a Property).
context
Type: PostSharp.Aspects.LocationValidationContext
Why or when the value is being validated.

Return Value

Type: Exception
An Exception if the value is invalid, or null if the value is valid.
See Also