Пример #1
0
        static void ThrowInvalidInitialCapacity(int initialCapacity, int maxCapacity)
        {
            if (initialCapacity < 0)
            {
                ThrowHelper.ThrowArgumentException_PositiveOrZero(initialCapacity, ExceptionArgument.initialCapacity);
            }

            if (initialCapacity > maxCapacity)
            {
                ThrowHelper.ThrowArgumentOutOfRangeException_InitialCapacity(initialCapacity, maxCapacity);
            }
        }
Пример #2
0
        static void Validate(int initialCapacity, int maxCapacity)
        {
            if (initialCapacity < 0)
            {
                ThrowHelper.ThrowArgumentOutOfRangeException_InitialCapacity();
            }

            if (initialCapacity > maxCapacity)
            {
                ThrowHelper.ThrowArgumentOutOfRangeException_InitialCapacity(initialCapacity, maxCapacity);
            }
        }
        static void ThrowInvalidInitialCapacity(int initialCapacity, int maxCapacity)
        {
            if ((uint)initialCapacity > SharedConstants.TooBigOrNegative)
            {
                ThrowHelper.ThrowArgumentException_PositiveOrZero(initialCapacity, ExceptionArgument.initialCapacity);
            }

            if (initialCapacity > maxCapacity)
            {
                ThrowHelper.ThrowArgumentOutOfRangeException_InitialCapacity(initialCapacity, maxCapacity);
            }
        }