Table of Contents

Class RangeAttribute

Namespace
Exiled.API.Features.Attributes.Validators
Assembly
Exiled.API.dll

Check if an IComparable is inside a specific range.

[AttributeUsage(AttributeTargets.Property)]
public class RangeAttribute : Attribute, _Attribute, IValidator
Inheritance
RangeAttribute
Implements
Inherited Members
Extension Methods

Constructors

RangeAttribute(object, object, bool)

Initializes a new instance of the RangeAttribute class.

public RangeAttribute(object min, object max, bool inclusive = false)

Parameters

min object
max object
inclusive bool

Remarks

min and max must inherit IComparable.

Properties

Inclusive

Gets a value indicating whether check is inclusive.

public bool Inclusive { get; }

Property Value

bool

Max

Gets the maximum value.

public object Max { get; }

Property Value

object

Min

Gets the minimum value.

public object Min { get; }

Property Value

object

Methods

Check(object)

Checks if other is satisfying this attributes condition.

public bool Check(object other)

Parameters

other object

Value to check.

Returns

bool

Whether the value has passed check.