IntegerValidator 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 IntegerValidator 类的新实例。
重载
| 名称 | 说明 |
|---|---|
| IntegerValidator(Int32, Int32) |
初始化 IntegerValidator 类的新实例。 |
| IntegerValidator(Int32, Int32, Boolean) |
初始化 IntegerValidator 类的新实例。 |
| IntegerValidator(Int32, Int32, Boolean, Int32) |
初始化 IntegerValidator 类的新实例。 |
IntegerValidator(Int32, Int32)
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
初始化 IntegerValidator 类的新实例。
public:
IntegerValidator(int minValue, int maxValue);
public IntegerValidator(int minValue, int maxValue);
new System.Configuration.IntegerValidator : int * int -> System.Configuration.IntegerValidator
Public Sub New (minValue As Integer, maxValue As Integer)
参数
注解
此 IntegerValidator 构造函数可确保所验证的整数同时遵循最小长度和最大长度。
适用于
IntegerValidator(Int32, Int32, Boolean)
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
初始化 IntegerValidator 类的新实例。
public:
IntegerValidator(int minValue, int maxValue, bool rangeIsExclusive);
public IntegerValidator(int minValue, int maxValue, bool rangeIsExclusive);
new System.Configuration.IntegerValidator : int * int * bool -> System.Configuration.IntegerValidator
Public Sub New (minValue As Integer, maxValue As Integer, rangeIsExclusive As Boolean)
参数
- rangeIsExclusive
- Boolean
true 如果指定验证范围是独占的,则为 。 非独占意味着要验证的值必须位于指定范围内;独占意味着它必须低于最小值或高于最大值。
示例
下面的代码示例演示如何使用 IntegerValidator 构造函数。 该代码示例是 IntegerValidator 类中的一个较大示例的一部分。
// Create Validator for the range of 1 to 10 inclusive
int minIntVal = 1;
int maxIntVal = 10;
bool exclusive = false;
IntegerValidator integerValidator =
new IntegerValidator(minIntVal, maxIntVal, exclusive);
' Create Validator for the range of 1 to 10 inclusive
Dim minIntVal As Int32 = 1
Dim maxIntVal As Int32 = 10
Dim exclusive As Boolean = False
Dim validator As IntegerValidator = _
New IntegerValidator(minIntVal, maxIntVal, exclusive)
注解
创建类的 IntegerValidator 实例时,此 IntegerValidator 构造函数会检查最小值和最大值 Int32 ,以及验证范围是否是独占的。
rangeIsExclusive将参数设置为true时,Int32该值不得介于参数值和minValue参数值之间maxValue。
适用于
IntegerValidator(Int32, Int32, Boolean, Int32)
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
- Source:
- IntegerValidator.cs
初始化 IntegerValidator 类的新实例。
public:
IntegerValidator(int minValue, int maxValue, bool rangeIsExclusive, int resolution);
public IntegerValidator(int minValue, int maxValue, bool rangeIsExclusive, int resolution);
new System.Configuration.IntegerValidator : int * int * bool * int -> System.Configuration.IntegerValidator
Public Sub New (minValue As Integer, maxValue As Integer, rangeIsExclusive As Boolean, resolution As Integer)
参数
例外
注解
Int32要验证的值必须等于resolution值才能通过验证。