PostSharpAPI ReferencePost­Sharp.​Patterns.​ContractsStrictly­Less­Than­Attribute
Open sandboxFocus

Class StrictlyLessThanAttribute

Custom attribute that, when added to a field, property or parameter, throws an ArgumentOutOfRangeException if the target is assigned a value that is greater than or equal to a given value.

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Common.dll
Syntax
public class StrictlyLessThanAttribute : RangeAttribute, ILocationLevelAspect, IValidableAnnotation, IAspect

Constructors

Name Description
StrictlyLessThanAttribute(Double)

Initializes a new StrictlyLessThanAttribute with a given floating-point bound.

StrictlyLessThanAttribute(Int64)

Initializes a new StrictlyLessThanAttribute with a given integer bound.

StrictlyLessThanAttribute(UInt64)

Initializes a new StrictlyLessThanAttribute with a given UInt64 bound.

Methods

Name Description
CreateException(Object, String, LocationKind, LocationValidationContext)
GetErrorMessage()

Gets unformatted error message as defined by the instance.

GetErrorMessageArguments()

Gets values of additional arguments for error message associated with particular instance of LocationContractAttribute. There arguments can be referenced from error message string by {4}, {5} and so on.