UnitRangeAttribute

StockSharp.Messages

单位值的幅度限制 。

继承自: RangeAttribute

实现: IValidator

构造函数

UnitRangeAttribute
public UnitRangeAttribute(Unit min, Unit max)
unitRangeAttribute = UnitRangeAttribute(min, max)

初始化了 & ##UnitRangeAttribute+#的新实例.

min
最低价值(含).
max
最大值( 包括) 。

属性

DisableNullCheck
public bool DisableNullCheck { get; set; }
value = unitRangeAttribute.DisableNullCheck
unitRangeAttribute.DisableNullCheck = value

Gets or sets a value indicating whether null checks should be disabled.

Max
public Unit Max { get; }
value = unitRangeAttribute.Max

最大值 。

Min
public Unit Min { get; }
value = unitRangeAttribute.Min

最低值。

方法

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.

返回值: True if the value is valid; otherwise, false.