Show / Hide Table of Contents

Class ArgumentExtensions

Extension methods for guarding

Inheritance
Object
ArgumentExtensions
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
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 System.IComparable

Exceptions
Type Condition
System.ArgumentOutOfRangeException

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
System.ArgumentNullException

IsNotNullOrEmpty(IArgument<String>, String)

Throws an System.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
System.ArgumentNullException
In this article
Back to top Generated by DocFX