Guard.IsBetween Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
IsBetween(SByte, SByte, SByte, String) |
Asserts that the input value must be in a given interval. |
IsBetween(UIntPtr, UIntPtr, UIntPtr, String) |
Asserts that the input value must be in a given interval. |
IsBetween(UInt64, UInt64, UInt64, String) |
Asserts that the input value must be in a given interval. |
IsBetween(UInt32, UInt32, UInt32, String) |
Asserts that the input value must be in a given interval. |
IsBetween(UInt16, UInt16, UInt16, String) |
Asserts that the input value must be in a given interval. |
IsBetween(Single, Single, Single, String) |
Asserts that the input value must be in a given interval. |
IsBetween(IntPtr, IntPtr, IntPtr, String) |
Asserts that the input value must be in a given interval. |
IsBetween(Double, Double, Double, String) |
Asserts that the input value must be in a given interval. |
IsBetween(Int32, Int32, Int32, String) |
Asserts that the input value must be in a given interval. |
IsBetween(Int16, Int16, Int16, String) |
Asserts that the input value must be in a given interval. |
IsBetween(Int64, Int64, Int64, String) |
Asserts that the input value must be in a given interval. |
IsBetween(Decimal, Decimal, Decimal, String) |
Asserts that the input value must be in a given interval. |
IsBetween(Char, Char, Char, String) |
Asserts that the input value must be in a given interval. |
IsBetween(Byte, Byte, Byte, String) |
Asserts that the input value must be in a given interval. |
IsBetween<T>(T, T, T, String) |
Asserts that the input value must be in a given interval. |
IsBetween(SByte, SByte, SByte, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (sbyte value, sbyte minimum, sbyte maximum, string name);
static member IsBetween : sbyte * sbyte * sbyte * string -> unit
Public Shared Sub IsBetween (value As SByte, minimum As SByte, maximum As SByte, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(UIntPtr, UIntPtr, UIntPtr, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (nuint value, nuint minimum, nuint maximum, string name);
static member IsBetween : unativeint * unativeint * unativeint * string -> unit
Public Shared Sub IsBetween (value As UIntPtr, minimum As UIntPtr, maximum As UIntPtr, name As String)
Parameters
- value
-
UIntPtr
nuint
unativeint
The input nuint
value to test.
- minimum
-
UIntPtr
nuint
unativeint
The exclusive minimum nuint
value that is accepted.
- maximum
-
UIntPtr
nuint
unativeint
The exclusive maximum nuint
value that is accepted.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(UInt64, UInt64, UInt64, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (ulong value, ulong minimum, ulong maximum, string name);
static member IsBetween : uint64 * uint64 * uint64 * string -> unit
Public Shared Sub IsBetween (value As ULong, minimum As ULong, maximum As ULong, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(UInt32, UInt32, UInt32, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (uint value, uint minimum, uint maximum, string name);
static member IsBetween : uint32 * uint32 * uint32 * string -> unit
Public Shared Sub IsBetween (value As UInteger, minimum As UInteger, maximum As UInteger, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(UInt16, UInt16, UInt16, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (ushort value, ushort minimum, ushort maximum, string name);
static member IsBetween : uint16 * uint16 * uint16 * string -> unit
Public Shared Sub IsBetween (value As UShort, minimum As UShort, maximum As UShort, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(Single, Single, Single, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (float value, float minimum, float maximum, string name);
static member IsBetween : single * single * single * string -> unit
Public Shared Sub IsBetween (value As Single, minimum As Single, maximum As Single, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(IntPtr, IntPtr, IntPtr, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (nint value, nint minimum, nint maximum, string name);
static member IsBetween : nativeint * nativeint * nativeint * string -> unit
Public Shared Sub IsBetween (value As IntPtr, minimum As IntPtr, maximum As IntPtr, name As String)
Parameters
- value
-
IntPtr
nint
nativeint
The input nint
value to test.
- minimum
-
IntPtr
nint
nativeint
The exclusive minimum nint
value that is accepted.
- maximum
-
IntPtr
nint
nativeint
The exclusive maximum nint
value that is accepted.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(Double, Double, Double, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (double value, double minimum, double maximum, string name);
static member IsBetween : double * double * double * string -> unit
Public Shared Sub IsBetween (value As Double, minimum As Double, maximum As Double, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(Int32, Int32, Int32, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (int value, int minimum, int maximum, string name);
static member IsBetween : int * int * int * string -> unit
Public Shared Sub IsBetween (value As Integer, minimum As Integer, maximum As Integer, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(Int16, Int16, Int16, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (short value, short minimum, short maximum, string name);
static member IsBetween : int16 * int16 * int16 * string -> unit
Public Shared Sub IsBetween (value As Short, minimum As Short, maximum As Short, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(Int64, Int64, Int64, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (long value, long minimum, long maximum, string name);
static member IsBetween : int64 * int64 * int64 * string -> unit
Public Shared Sub IsBetween (value As Long, minimum As Long, maximum As Long, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(Decimal, Decimal, Decimal, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (decimal value, decimal minimum, decimal maximum, string name);
static member IsBetween : decimal * decimal * decimal * string -> unit
Public Shared Sub IsBetween (value As Decimal, minimum As Decimal, maximum As Decimal, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(Char, Char, Char, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (char value, char minimum, char maximum, string name);
static member IsBetween : char * char * char * string -> unit
Public Shared Sub IsBetween (value As Char, minimum As Char, maximum As Char, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween(Byte, Byte, Byte, String)
Asserts that the input value must be in a given interval.
public static void IsBetween (byte value, byte minimum, byte maximum, string name);
static member IsBetween : byte * byte * byte * string -> unit
Public Shared Sub IsBetween (value As Byte, minimum As Byte, maximum As Byte, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.
Applies to
IsBetween<T>(T, T, T, String)
Asserts that the input value must be in a given interval.
public static void IsBetween<T> (T value, T minimum, T maximum, string name) where T : IComparable<T>;
static member IsBetween : 'T * 'T * 'T * string -> unit (requires 'T :> IComparable<'T>)
Public Shared Sub IsBetween(Of T As IComparable(Of T)) (value As T, minimum As T, maximum As T, name As String)
Type Parameters
- T
The type of input values to compare.
Parameters
- value
- T
The input T
value to test.
- minimum
- T
The exclusive minimum T
value that is accepted.
- maximum
- T
The exclusive maximum T
value that is accepted.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if value
is <= minimum
or >= maximum
.
Remarks
This API asserts the equivalent of "value
in (minimum
, maximum
)", using arithmetic notation. The method is generic to avoid boxing the parameters, if they are value types.