LongValidatorAttribute.ExcludeRange 属性
定义
public:
property bool ExcludeRange { bool get(); void set(bool value); };
public bool ExcludeRange { get; set; }
member this.ExcludeRange : bool with get, set
Public Property ExcludeRange As Boolean
属性值
如果必须排除值,则为 true;否则为 false。true if the value must be excluded; otherwise, false. 默认值为 false。The default is false.
示例
下面的示例演示如何使用 ExcludeRange 属性。The following example shows how to use the ExcludeRange property.
[ConfigurationProperty("maxUsers", DefaultValue = (long)10000,
IsRequired = false)]
[LongValidator(MinValue = 1, MaxValue = 10000000,
ExcludeRange = false)]
public long MaxUsers
{
get
{
return (long)this["maxUsers"];
}
set
{
this["maxUsers"] = value;
}
}
<ConfigurationProperty("maxUsers", _
DefaultValue:=10000, _
IsRequired:=False), _
LongValidator(MinValue:=1, _
MaxValue:=10000000, _
ExcludeRange:=False)> _
Public Property MaxUsers() As Long
Get
Return Fix(Me("maxUsers"))
End Get
Set(ByVal value As Long)
Me("maxUsers") = value
End Set
End Property
注解
范围包含 MinValue 和 MaxValue 属性值。The range is inclusive of the MinValue and MaxValue property values. 当 ExcludeRange 属性值为时 false ,允许的值超出范围。When the ExcludeRange property value is false, the allowed values are outside the range.