PostSharpAPI ReferencePost­Sharp.​Patterns.​ContractsNegative­Attribute
Open sandboxFocus

NegativeAttribute Class

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

Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Common.dll
Syntax
public class NegativeAttribute : LessThanAttribute, ILocationLevelAspect, IValidableAnnotation, IAspect
Remarks

Null values are accepted and do not throw an exception.

Error message is identified by LessThanErrorMessage.

Constructors

Name Description
NegativeAttribute()

Initializes a new NegativeAttribute.