System.Data.DataRelationCollection.CopyTo C# (CSharp) Method

CopyTo() public method

public CopyTo ( DataRelation array, int index ) : void
array DataRelation
index int
return void
        public void CopyTo(DataRelation[] array, int index)
        {
            if (array == null)
            {
                throw ExceptionBuilder.ArgumentNull(nameof(array));
            }

            if (index < 0)
            {
                throw ExceptionBuilder.ArgumentOutOfRange(nameof(index));
            }

            ArrayList alist = List;
            if (array.Length - index < alist.Count)
            {
                throw ExceptionBuilder.InvalidOffsetLength();
            }

            for (int i = 0; i < alist.Count; ++i)
            {
                array[index + i] = (DataRelation)alist[i];
            }
        }