IntegerValidator Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy IntegerValidator.

Przeciążenia

IntegerValidator(Int32, Int32)

Inicjuje nowe wystąpienie klasy IntegerValidator.

IntegerValidator(Int32, Int32, Boolean)

Inicjuje nowe wystąpienie klasy IntegerValidator.

IntegerValidator(Int32, Int32, Boolean, Int32)

Inicjuje nowe wystąpienie klasy IntegerValidator.

IntegerValidator(Int32, Int32)

Źródło:
IntegerValidator.cs
Źródło:
IntegerValidator.cs
Źródło:
IntegerValidator.cs

Inicjuje nowe wystąpienie klasy 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)

Parametry

minValue
Int32

Int32 Obiekt określający minimalną wartość.

maxValue
Int32

Obiekt Int32 określający maksymalną wartość.

Uwagi

Ten IntegerValidator konstruktor zapewnia, że zweryfikowana liczba całkowita jest zgodna zarówno z minimalną, jak i maksymalną długością.

Dotyczy

IntegerValidator(Int32, Int32, Boolean)

Źródło:
IntegerValidator.cs
Źródło:
IntegerValidator.cs
Źródło:
IntegerValidator.cs

Inicjuje nowe wystąpienie klasy 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)

Parametry

minValue
Int32

Int32 Obiekt określający minimalną wartość.

maxValue
Int32

Obiekt Int32 określający maksymalną wartość.

rangeIsExclusive
Boolean

true aby określić, że zakres weryfikacji jest wyłączny. Włącznie oznacza, że wartość do zweryfikowania musi mieścić się w określonym zakresie; wyłączne oznacza, że musi być poniżej wartości minimalnej lub powyżej wartości maksymalnej.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać konstruktora IntegerValidator . Ten przykład kodu jest częścią większego przykładu podanego IntegerValidator dla klasy.

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

Uwagi

Podczas tworzenia wystąpienia IntegerValidator klasy ten IntegerValidator konstruktor sprawdza zarówno wartości minimalne, jak i maksymalne Int32 , a także czy zakres weryfikacji jest wyłączny. rangeIsExclusive Gdy parametr jest ustawiony na truewartość , Int32 wartość nie może znajdować się między wartościami parametrów minValue i maxValue .

Dotyczy

IntegerValidator(Int32, Int32, Boolean, Int32)

Źródło:
IntegerValidator.cs
Źródło:
IntegerValidator.cs
Źródło:
IntegerValidator.cs

Inicjuje nowe wystąpienie klasy 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)

Parametry

minValue
Int32

Int32 Obiekt określający minimalną długość wartości całkowitej.

maxValue
Int32

Int32 Obiekt określający maksymalną długość wartości całkowitej.

rangeIsExclusive
Boolean

Boolean Wartość określająca, czy zakres weryfikacji jest wyłączny.

resolution
Int32

Int32 Obiekt, który określa wartość, która musi być zgodna.

Wyjątki

resolution wartość jest mniejsza niż 0.

-lub-

minValue wartość jest większa niż maxValue.

Uwagi

Zweryfikowana Int32 wartość musi być równa resolution wartości w celu przekazania walidacji.

Dotyczy