PostSharpAPI ReferencePost­Sharp.​Patterns.​ThreadingRequires­Thread­Safe­AttributeILocation­Validation­Aspect<Object>.​Validate­Value
Open sandboxFocus

RequiresThreadSafeAttribute.ILocationValidationAspect<Object>.ValidateValue Method

ILocationValidationAspect<Object>.ValidateValue(Object, String, LocationKind, LocationValidationContext)

Validates the value being assigned to the location to which the current aspect has been applied.

Declaration
[DebuggerAspectMethod]
Exception ILocationValidationAspect<object>.ValidateValue(object value, string locationName, LocationKind locationKind, LocationValidationContext context)
Parameters
Type Name Description
Object value
System.String locationName

Name of the location.

LocationKind locationKind

Location kind (Field, Property, or Parameter).

LocationValidationContext context

Indicates the context in which the value is being validated, such as precondition or postcondition for ref method parameters.

Returns
Type Description
Exception

The Exception to be thrown, or null if no exception needs to be thrown.

Implements
ILocationValidationAspect<T>.ValidateValue(T, String, LocationKind, LocationValidationContext)