Пример #1
0
 public static void RequiresInInclusiveRange(uint start, uint length)
 {
     if (start > length)
     {
         BufferPrimitivesThrowHelper.ThrowArgumentOutOfRangeException();
     }
 }
Пример #2
0
 public static void RequiresNonNegative(int n)
 {
     if (n < 0)
     {
         BufferPrimitivesThrowHelper.ThrowArgumentOutOfRangeException();
     }
 }
Пример #3
0
 internal static unsafe void RequiresOneNotNull <T>(T[] array, void *pointer)
 {
     if (array == null && pointer == null)
     {
         BufferPrimitivesThrowHelper.ThrowArgumentException();
     }
 }
Пример #4
0
 public static unsafe void RequiresSameReference(void *ptr0, void *ptr1)
 {
     if (ptr0 != ptr1)
     {
         BufferPrimitivesThrowHelper.ThrowArgumentException(ExceptionArgument.pointer);
     }
 }
Пример #5
0
 public static unsafe void RequiresNotNull(ExceptionArgument argument, void *ptr)
 {
     if (ptr == null)
     {
         BufferPrimitivesThrowHelper.ThrowArgumentNullException(argument);
     }
 }
Пример #6
0
 public static void RequiresNotNull <T>(ExceptionArgument argument, T obj) where T : class
 {
     if (obj == null)
     {
         BufferPrimitivesThrowHelper.ThrowArgumentNullException(argument);
     }
 }
Пример #7
0
 public static void Requires(bool condition)
 {
     if (!condition)
     {
         BufferPrimitivesThrowHelper.ThrowArgumentException();
     }
 }
Пример #8
0
 public static void RequiresInInclusiveRange(int start, int length, uint existingLength)
 {
     if ((uint)start > existingLength ||
         length < 0 ||
         (uint)(start + length) > existingLength)
     {
         BufferPrimitivesThrowHelper.ThrowArgumentOutOfRangeException();
     }
 }