Export (0) Print
Expand All

IntegerValidator Constructor (Int32, Int32, Boolean)

Initializes a new instance of the IntegerValidator class.

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)

public IntegerValidator(
	int minValue,
	int maxValue,
	bool rangeIsExclusive


Type: System.Int32

An Int32 object that specifies the minimum value.

Type: System.Int32

An Int32 object that specifies the maximum value.

Type: System.Boolean

true to specify that the validation range is exclusive. Inclusive means the value to be validated must be within the specified range; exclusive means that it must be below the minimum or above the maximum.

When creating an instance of the IntegerValidator class, this IntegerValidator constructor checks both the minimum and maximum Int32 values, as well as whether the validation range is exclusive. When the rangeIsExclusive parameter is set to true, the Int32 value must not be between the minValue and maxValue parameter values.

The following code example demonstrates how to use the IntegerValidator constructor. This code example is part of a larger example provided for the IntegerValidator class.

// 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);

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft