LongValidator Constructors

Definition

Initializes a new instance of the LongValidator class.

Overloads

LongValidator(Int64, Int64)

Initializes a new instance of the LongValidator class.

LongValidator(Int64, Int64, Boolean)

Initializes a new instance of the LongValidator class.

LongValidator(Int64, Int64, Boolean, Int64)

Initializes a new instance of the LongValidator class.

LongValidator(Int64, Int64)

Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs

Initializes a new instance of the LongValidator class.

C#
public LongValidator(long minValue, long maxValue);

Parameters

minValue
Int64

An Int64 value that specifies the minimum length of the long value.

maxValue
Int64

An Int64 value that specifies the maximum length of the long value.

Remarks

The LongValidator constructor ensures that the long value being verified adheres to both a minimum and a maximum length.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

LongValidator(Int64, Int64, Boolean)

Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs

Initializes a new instance of the LongValidator class.

C#
public LongValidator(long minValue, long maxValue, bool rangeIsExclusive);

Parameters

minValue
Int64

An Int64 value that specifies the minimum length of the long value.

maxValue
Int64

An Int64 value that specifies the maximum length of the long value.

rangeIsExclusive
Boolean

A Boolean value that specifies whether the validation range is exclusive.

Examples

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

C#
// Create Long and Validator.
Int64 testLong =    17592186044416;
Int64 minLongVal =  1099511627776;
Int64 maxLongVal =  281474976710656;
LongValidator myLongValidator = 
 new LongValidator(minLongVal, maxLongVal, false);

Remarks

When the LongValidator constructor is used, it checks both the minimum and maximum Int64 values, as well as whether the validation range is exclusive. When the rangeIsExclusive parameter is set to true, the Int64 value must not be between minValue and maxValue.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

LongValidator(Int64, Int64, Boolean, Int64)

Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs
Source:
LongValidator.cs

Initializes a new instance of the LongValidator class.

C#
public LongValidator(long minValue, long maxValue, bool rangeIsExclusive, long resolution);

Parameters

minValue
Int64

An Int64 value that specifies the minimum length of the long value.

maxValue
Int64

An Int64 value that specifies the maximum length of the long value.

rangeIsExclusive
Boolean

A Boolean value that specifies whether the validation range is exclusive.

resolution
Int64

An Int64 value that specifies a specific value that must be matched.

Exceptions

resolution is equal to or less than 0.

-or-

maxValue is less than minValue.

Remarks

When you specify the resolution, the Int64 value being validated must be equal to that value in order to pass validation.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10