System.ThrowHelper.ThrowIndexOutOfRangeException C# (CSharp) Метод

ThrowIndexOutOfRangeException() статический приватный Метод

static private ThrowIndexOutOfRangeException ( ) : void
Результат void
        internal static void ThrowIndexOutOfRangeException() { throw CreateIndexOutOfRangeException(); }
        [MethodImpl(MethodImplOptions.NoInlining)]

Usage Example

Пример #1
0
        public static void Clear(Array array, int index, int length)
        {
            if (array == null)
            {
                ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array);
            }
            if (length < 0)
            {
                ThrowHelper.ThrowIndexOutOfRangeException();
            }

            int low = array.GetLowerBound(0);

            if (index < low)
            {
                ThrowHelper.ThrowIndexOutOfRangeException();
            }

            index = index - low;

            // re-ordered to avoid possible integer overflow
            if (index > array.Length - length)
            {
                ThrowHelper.ThrowIndexOutOfRangeException();
            }

            ClearInternal(array, index, length);
        }
All Usage Examples Of System.ThrowHelper::ThrowIndexOutOfRangeException