UnitRangeAttribute
StockSharp.Messages
Range restriction for Unit values.
Inherits: RangeAttribute
Implements: IValidator
Constructors
UnitRangeAttribute
public UnitRangeAttribute(Unit min, Unit max)
unitRangeAttribute = UnitRangeAttribute(min, max)
Initializes a new instance of the UnitRangeAttribute.
- min
- Minimum value (inclusive).
- max
- Maximum value (inclusive).
Properties
DisableNullCheck
public bool DisableNullCheck { get; set; }
value = unitRangeAttribute.DisableNullCheck
unitRangeAttribute.DisableNullCheck = value
Gets or sets a value indicating whether null checks should be disabled.
Methods
IsValid
public override bool IsValid(object value)
result = unitRangeAttribute.IsValid(value)
Validates the specified value by converting it and applying the custom validation.
- value
- The value to validate.
Returns: True if the value is valid; otherwise, false.