T
CSharpTest.Net
InRange<T> Method
See Also  Send Feedback Download Help File
CSharpTest.Net.Library Assembly > (Global) Namespace > Check Class : InRange<T> Method

value
min
max

Glossary Item Box

Verifies that the value is min, max, or between the two. throws ArgumentOutOfRangeException

Syntax

Visual Basic (Declaration) 
Public Shared Function InRange(Of T As IComparable(Of T))( _
   ByVal value As T, _
   ByVal min As T, _
   ByVal max As T _
) As T
C# 
public static T InRange<T>( 
   T value,
   T min,
   T max
)
where T: IComparable<T>

Parameters

value
min
max

Type Parameters

T

Exceptions

ExceptionDescription
System.ArgumentNullExceptionThe exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.
System.ArgumentOutOfRangeExceptionThe exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method.

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys