88namespace SixLabors
99{
1010 /// <summary>
11- /// Helper methods to throw exceptions
11+ /// Helper methods to throw exceptions.
1212 /// </summary>
13+ #pragma warning disable RCS1043 // Remove 'partial' modifier from type with a single part.
1314 internal static partial class ThrowHelper
15+ #pragma warning restore RCS1043 // Remove 'partial' modifier from type with a single part.
1416 {
1517 /// <summary>
1618 /// Throws an <see cref="ArgumentNullException"/> when <see cref="Guard.NotNull{TValue}"/> fails.
1719 /// </summary>
20+ /// <param name="name">The argument name.</param>
1821 [ DoesNotReturn ]
1922 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
2023 public static void ThrowArgumentNullExceptionForNotNull ( string name )
@@ -23,6 +26,8 @@ public static void ThrowArgumentNullExceptionForNotNull(string name)
2326 /// <summary>
2427 /// Throws an <see cref="ArgumentException"/> when <see cref="Guard.NotNullOrWhiteSpace"/> fails.
2528 /// </summary>
29+ /// <param name="value">The value.</param>
30+ /// <param name="name">The argument name.</param>
2631 [ DoesNotReturn ]
2732 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
2833 public static void ThrowArgumentExceptionForNotNullOrWhitespace ( string value , string name )
@@ -40,6 +45,10 @@ public static void ThrowArgumentExceptionForNotNullOrWhitespace(string value, st
4045 /// <summary>
4146 /// Throws an <see cref="ArgumentOutOfRangeException"/> when <see cref="Guard.MustBeLessThan{TValue}"/> fails.
4247 /// </summary>
48+ /// <typeparam name="T">The type of value.</typeparam>
49+ /// <param name="value">The value.</param>
50+ /// <param name="max">The maximum allowable value.</param>
51+ /// <param name="name">The argument name.</param>
4352 [ DoesNotReturn ]
4453 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
4554 public static void ThrowArgumentOutOfRangeExceptionForMustBeLessThan < T > ( T value , T max , string name )
@@ -48,6 +57,10 @@ public static void ThrowArgumentOutOfRangeExceptionForMustBeLessThan<T>(T value,
4857 /// <summary>
4958 /// Throws an <see cref="ArgumentOutOfRangeException"/> when <see cref="Guard.MustBeLessThanOrEqualTo{TValue}"/> fails.
5059 /// </summary>
60+ /// <typeparam name="T">The type of value.</typeparam>
61+ /// <param name="value">The value.</param>
62+ /// <param name="maximum">The maximum allowable value.</param>
63+ /// <param name="name">The argument name.</param>
5164 [ DoesNotReturn ]
5265 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
5366 public static void ThrowArgumentOutOfRangeExceptionForMustBeLessThanOrEqualTo < T > ( T value , T maximum , string name )
@@ -56,27 +69,45 @@ public static void ThrowArgumentOutOfRangeExceptionForMustBeLessThanOrEqualTo<T>
5669 /// <summary>
5770 /// Throws an <see cref="ArgumentOutOfRangeException"/> when <see cref="Guard.MustBeGreaterThan{TValue}"/> fails.
5871 /// </summary>
72+ /// <typeparam name="T">The type of value.</typeparam>
73+ /// <param name="value">The value.</param>
74+ /// <param name="minimum">The minimum allowable value.</param>
75+ /// <param name="name">The argument name.</param>
5976 [ DoesNotReturn ]
6077 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
61- public static void ThrowArgumentOutOfRangeExceptionForMustBeGreaterThan < T > ( T value , T minimum , string name ) => ThrowArgumentOutOfRangeException ( name , $ "Parameter \" { name } \" ({ typeof ( T ) } ) must be greater than { minimum } , was { value } ") ;
78+ public static void ThrowArgumentOutOfRangeExceptionForMustBeGreaterThan < T > ( T value , T minimum , string name )
79+ => ThrowArgumentOutOfRangeException ( name , $ "Parameter \" { name } \" ({ typeof ( T ) } ) must be greater than { minimum } , was { value } ") ;
6280
6381 /// <summary>
6482 /// Throws an <see cref="ArgumentOutOfRangeException"/> when <see cref="Guard.MustBeGreaterThanOrEqualTo{TValue}"/> fails.
6583 /// </summary>
84+ /// <typeparam name="T">The type of value.</typeparam>
85+ /// <param name="value">The value.</param>
86+ /// <param name="minimum">The minimum allowable value.</param>
87+ /// <param name="name">The argument name.</param>
6688 [ DoesNotReturn ]
6789 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
68- public static void ThrowArgumentOutOfRangeExceptionForMustBeGreaterThanOrEqualTo < T > ( T value , T minimum , string name ) => ThrowArgumentOutOfRangeException ( name , $ "Parameter \" { name } \" ({ typeof ( T ) } ) must be greater than or equal to { minimum } , was { value } ") ;
90+ public static void ThrowArgumentOutOfRangeExceptionForMustBeGreaterThanOrEqualTo < T > ( T value , T minimum , string name )
91+ => ThrowArgumentOutOfRangeException ( name , $ "Parameter \" { name } \" ({ typeof ( T ) } ) must be greater than or equal to { minimum } , was { value } ") ;
6992
7093 /// <summary>
7194 /// Throws an <see cref="ArgumentOutOfRangeException"/> when <see cref="Guard.MustBeBetweenOrEqualTo{TValue}"/> fails.
7295 /// </summary>
96+ /// <typeparam name="T">The type of value.</typeparam>
97+ /// <param name="value">The value.</param>
98+ /// <param name="minimum">The minimum allowable value.</param>
99+ /// <param name="maximum">The maximum allowable value.</param>
100+ /// <param name="name">The argument name.</param>
73101 [ DoesNotReturn ]
74102 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
75- public static void ThrowArgumentOutOfRangeExceptionForMustBeBetweenOrEqualTo < T > ( T value , T minimum , T maximum , string name ) => ThrowArgumentOutOfRangeException ( name , $ "Parameter \" { name } \" ({ typeof ( T ) } ) must be between or equal to { minimum } and { maximum } , was { value } ") ;
103+ public static void ThrowArgumentOutOfRangeExceptionForMustBeBetweenOrEqualTo < T > ( T value , T minimum , T maximum , string name )
104+ => ThrowArgumentOutOfRangeException ( name , $ "Parameter \" { name } \" ({ typeof ( T ) } ) must be between or equal to { minimum } and { maximum } , was { value } ") ;
76105
77106 /// <summary>
78107 /// Throws an <see cref="ArgumentException"/> when <see cref="Guard.MustBeSizedAtLeast{T}(ReadOnlySpan{T},int,string)"/> fails.
79108 /// </summary>
109+ /// <param name="minLength">The minimum allowable length.</param>
110+ /// <param name="parameterName">The paramere name.</param>
80111 [ DoesNotReturn ]
81112 [ MethodImpl ( MethodImplOptions . NoInlining ) ]
82113 public static void ThrowArgumentOutOfRangeExceptionForMustBeSizedAtLeast ( int minLength , string parameterName )
0 commit comments