System.Xml.Schema.XmlSchemaCollection.CopyTo C# (CSharp) Method

CopyTo() public method

public CopyTo ( XmlSchema array, int index ) : void
array XmlSchema
index int
return void
        public void CopyTo(XmlSchema[] array, int index)
        {
            if (array == null)
                throw new ArgumentNullException(nameof(array));
            if (index < 0)
                throw new ArgumentOutOfRangeException(nameof(index));
            for (XmlSchemaCollectionEnumerator e = this.GetEnumerator(); e.MoveNext();)
            {
                XmlSchema schema = e.Current;
                if (schema != null)
                {
                    if (index == array.Length)
                    {
                        throw new ArgumentOutOfRangeException(nameof(index));
                    }
                    array[index++] = e.Current;
                }
            }
        }