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
Remarks
min and max must inherit IComparable.
Properties
Inclusive
Gets a value indicating whether check is inclusive.
public bool Inclusive { get; }
Property Value
Max
Gets the maximum value.
public object Max { get; }
Property Value
Min
Gets the minimum value.
public object Min { get; }
Property Value
Methods
Check(object)
Checks if other is satisfying this attributes condition.
public bool Check(object other)
Parameters
otherobjectValue to check.
Returns
- bool
Whether the value has passed check.