Class ArgumentExtensions
Extension methods for guarding
Inherited Members
Namespace: OfficeOpenXml.Utils
Assembly: EPPlus.dll
Syntax
public static class ArgumentExtensions
Methods
IsInRange<T>(IArgument<T>, T, T, string)
Throws an ArgumentOutOfRangeException if the value of the argument is out of the supplied range
Declaration
public static void IsInRange<T>(this IArgument<T> argument, T min, T max, string argumentName) where T : IComparable
Parameters
| Type | Name | Description |
|---|---|---|
| IArgument<T> | argument | The argument to check |
| T | min | Min value of the supplied range |
| T | max | Max value of the supplied range |
| string | argumentName | parameter/argument name |
Type Parameters
| Name | Description |
|---|---|
| T | Type implementing IComparable |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException |
IsNotNullOrEmpty(IArgument<string>, string)
Throws an ArgumentNullException if the string argument is null or empty
Declaration
public static void IsNotNullOrEmpty(this IArgument<string> argument, string argumentName)
Parameters
| Type | Name | Description |
|---|---|---|
| IArgument<string> | argument | Argument to check |
| string | argumentName | parameter/argument name |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
IsNotNull<T>(IArgument<T>, string)
Throws an ArgumentNullException if argument is null
Declaration
public static void IsNotNull<T>(this IArgument<T> argument, string argumentName) where T : class
Parameters
| Type | Name | Description |
|---|---|---|
| IArgument<T> | argument | Argument to check |
| string | argumentName | parameter/argument name |
Type Parameters
| Name | Description |
|---|---|
| T | Argument type |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |