Class ThrowHelper
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Class that provides helper methods for throwing exceptions.
[Version(4, 0, 0)]
public static class ThrowHelper
- Inheritance
-
ThrowHelper
- Inherited Members
Methods
- ThrowContainerEmpty()
Throws an InvalidOperationException indicating the container is empty.
- ThrowContainerFull()
Throws an InvalidOperationException indicating the container is full.
- ThrowIfEmpty<T>(IList<T>, string)
Throws an InvalidOperationException if the list is empty.
- ThrowIfEmpty<T>(T[], string)
Throws an InvalidOperationException if the array is empty.
- ThrowIfNegative(int, string)
Throws an ArgumentOutOfRangeException if the integer is negative.
- ThrowIfNegative(float, string)
Throws an ArgumentOutOfRangeException if the float is negative.
- ThrowIfNotAssignableFrom(Type, Type)
Throws an ArgumentException if
targetTypeis not assignable fromsourceType.
- ThrowIfNotAssignableFrom<T>(Type)
Throws an ArgumentException if
targetTypeis not assignable fromT.
- ThrowIfNotPositive(int, string)
Throws an ArgumentOutOfRangeException if the integer is not positive (i.e. zero or negative).
- ThrowIfNull(object, string)
Throws an ArgumentNullException if the given argument is null.
- ThrowIfNullOrEmpty(string, string)
Throws an ArgumentNullException if the string is null or empty.
- ThrowIfNullOrWhiteSpace(string, string)
Throws an ArgumentNullException if the string is null, empty, or whitespace.
- ThrowIfNull<T>(T, string)
Throws an ArgumentNullException if the object is null.
- ThrowIfOutOfRange(int, int, int, string)
Throws an ArgumentOutOfRangeException if the integer is out of range.