ArgumentOutOfRange() static private méthode

The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method.
static private ArgumentOutOfRange ( string paramName ) : Exception
paramName string
Résultat System.Exception
Exemple #1
0
        internal override Expression GetExpression(int index)
        {
            switch (index)
            {
            case 0: return(ReturnObject <Expression>(_arg0));

            case 1: return(_arg1);

            case 2: return(_arg2);

            case 3: return(_arg3);

            default: throw Error.ArgumentOutOfRange("index");
            }
        }
        public void CopyTo(T[] array, int index)
        {
            ContractUtils.RequiresNotNull(array, nameof(array));
            if (index < 0)
            {
                throw LinqError.ArgumentOutOfRange(nameof(index));
            }

            int n = ElementCount;

            Debug.Assert(n > 0);
            if (index + n > array.Length)
            {
                throw new ArgumentException();
            }

            array[index++] = First;
            for (int i = 1; i < n; i++)
            {
                array[index++] = GetElement(i);
            }
        }
Exemple #3
0
        public void CopyTo(Expression[] array, int index)
        {
            ContractUtils.RequiresNotNull(array, nameof(array));
            if (index < 0)
            {
                throw Error.ArgumentOutOfRange(nameof(index));
            }

            int n = _block.ExpressionCount;

            Debug.Assert(n > 0);
            if (index + n > array.Length)
            {
                throw new ArgumentException();
            }

            array[index++] = _arg0;
            for (int i = 1; i < n; i++)
            {
                array[index++] = _block.GetExpression(i);
            }
        }