64 lines
No EOL
1.7 KiB
C#
64 lines
No EOL
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Security;
|
|
|
|
namespace JD.Collections
|
|
{
|
|
internal class ThrowHelper
|
|
{
|
|
internal static void ThrowArgumentException()
|
|
{
|
|
throw new ArgumentException("value");
|
|
}
|
|
|
|
internal static void ThrowArgumentNullException()
|
|
{
|
|
throw new ArgumentNullException("value");
|
|
}
|
|
|
|
internal static void ThrowArgumentOutOfRangeException()
|
|
{
|
|
throw new ArgumentOutOfRangeException("index");
|
|
}
|
|
|
|
internal static void ThrowInvalidOperationException()
|
|
{
|
|
throw new InvalidOperationException();
|
|
}
|
|
|
|
internal static void ThrowKeyNotFoundException()
|
|
{
|
|
throw new KeyNotFoundException();
|
|
}
|
|
|
|
internal static void ThrowNotSupportedException()
|
|
{
|
|
throw new NotSupportedException();
|
|
}
|
|
|
|
internal static void ThrowObjectDisposedException(string objectName, object resource)
|
|
{
|
|
throw new ObjectDisposedException(objectName);
|
|
}
|
|
|
|
internal static void ThrowSecurityException(object resource)
|
|
{
|
|
throw new SecurityException();
|
|
}
|
|
|
|
internal static void ThrowUnauthorizedAccessException(object resource)
|
|
{
|
|
throw new UnauthorizedAccessException("");
|
|
}
|
|
|
|
internal static void ThrowWrongKeyTypeArgumentException(object key, Type targetType)
|
|
{
|
|
throw new ArgumentException("", "key");
|
|
}
|
|
|
|
internal static void ThrowWrongValueTypeArgumentException(object value, Type targetType)
|
|
{
|
|
throw new ArgumentException("", "value");
|
|
}
|
|
}
|
|
} |