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;
}
}
}