Method ValidateRange
ValidateRange<T>(T, T, T, String)
Verifies a parameter is within a valid range.
Declaration
public static void ValidateRange<T>(this T i, T min, T max, string paramName)
where T : struct, IComparable<T>
Parameters
public static void ValidateRange<T>(this T i, T min, T max, string paramName)
where T : struct, IComparable<T>
T | i | Value of the parameter to test. |
T | min | Minimum allowed value. |
T | max | Maximum allowed value. |
System.String | paramName | Name of the parameter for the exception if the |
Type Parameters
T | Type of the parameter (must be a value type supporting comparisons). |