void ICollection.CopyTo(Array array, int index) { ArgumentNullException.ThrowIfNull(array); if (index < 0) { throw new ArgumentOutOfRangeException(nameof(index)); } for (XmlSchemaCollectionEnumerator e = this.GetEnumerator(); e.MoveNext();) { if (index == array.Length) { throw new ArgumentOutOfRangeException(nameof(index)); } array.SetValue(e.Current, index++); } }
/// <include file='doc\XmlSchemaCollection.uex' path='docs/doc[@for="XmlSchemaCollection.ICollection.CopyTo"]/*' /> /// <internalonly/> void ICollection.CopyTo(Array array, int index) { if (array == null) { throw new ArgumentNullException("array"); } if (index < 0) { throw new ArgumentOutOfRangeException("index"); } for (XmlSchemaCollectionEnumerator e = this.GetEnumerator(); e.MoveNext();) { if (index == array.Length && array.IsFixedSize) { throw new ArgumentOutOfRangeException("index"); } array.SetValue(e.Current, index++); } }
public void CopyTo(XmlSchema[] array, int index) { ArgumentNullException.ThrowIfNull(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 !; } } }
/// <include file='doc\XmlSchemaCollection.uex' path='docs/doc[@for="XmlSchemaCollection.CopyTo"]/*' /> /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public void CopyTo(XmlSchema[] array, int index) { if (array == null) { throw new ArgumentNullException("array"); } if (index < 0) { throw new ArgumentOutOfRangeException("index"); } for (XmlSchemaCollectionEnumerator e = this.GetEnumerator(); e.MoveNext();) { XmlSchema schema = e.Current; if (schema != null) { if (index == array.Length) { throw new ArgumentOutOfRangeException("index"); } array[index++] = e.Current; } } }
public void CopyTo(XmlSchema[] array, int index) { if (array == null) { throw new ArgumentNullException("array"); } if (index < 0) { throw new ArgumentOutOfRangeException("index"); } XmlSchemaCollectionEnumerator enumerator = this.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current != null) { if (index == array.Length) { throw new ArgumentOutOfRangeException("index"); } array[index++] = enumerator.Current; } } }
private ValidationType DetectValidationType() { //Type not yet detected : Check in Schema Collection if (reader.Schemas != null && reader.Schemas.Count > 0) { XmlSchemaCollectionEnumerator enumerator = reader.Schemas.GetEnumerator(); while (enumerator.MoveNext()) { XmlSchemaCollectionNode node = enumerator.CurrentNode !; SchemaInfo schemaInfo = node.SchemaInfo !; if (schemaInfo.SchemaType == SchemaType.XSD) { return(ValidationType.Schema); } else if (schemaInfo.SchemaType == SchemaType.XDR) { return(ValidationType.XDR); } } } if (reader.NodeType == XmlNodeType.Element) { SchemaType schemaType = SchemaNames.SchemaTypeFromRoot(reader.LocalName, reader.NamespaceURI); if (schemaType == SchemaType.XSD) { return(ValidationType.Schema); } else if (schemaType == SchemaType.XDR) { return(ValidationType.XDR); } else { int count = reader.AttributeCount; for (int i = 0; i < count; i++) { reader.MoveToAttribute(i); string objectNs = reader.NamespaceURI; string objectName = reader.LocalName; if (Ref.Equal(objectNs, SchemaNames.NsXmlNs)) { if (XdrBuilder.IsXdrSchema(reader.Value)) { reader.MoveToElement(); return(ValidationType.XDR); } } else if (Ref.Equal(objectNs, SchemaNames.NsXsi)) { reader.MoveToElement(); return(ValidationType.Schema); } else if (Ref.Equal(objectNs, SchemaNames.QnDtDt.Namespace) && Ref.Equal(objectName, SchemaNames.QnDtDt.Name)) { reader.SchemaTypeObject = XmlSchemaDatatype.FromXdrName(reader.Value); reader.MoveToElement(); return(ValidationType.XDR); } } //end of for if (count > 0) { reader.MoveToElement(); } } } return(ValidationType.Auto); }
private ValidationType DetectValidationType() { if ((base.reader.Schemas != null) && (base.reader.Schemas.Count > 0)) { XmlSchemaCollectionEnumerator enumerator = base.reader.Schemas.GetEnumerator(); while (enumerator.MoveNext()) { SchemaInfo schemaInfo = enumerator.CurrentNode.SchemaInfo; if (schemaInfo.SchemaType == SchemaType.XSD) { return(ValidationType.Schema); } if (schemaInfo.SchemaType == SchemaType.XDR) { return(ValidationType.XDR); } } } if (base.reader.NodeType == XmlNodeType.Element) { switch (base.SchemaNames.SchemaTypeFromRoot(base.reader.LocalName, base.reader.NamespaceURI)) { case SchemaType.XSD: return(ValidationType.Schema); case SchemaType.XDR: return(ValidationType.XDR); } int attributeCount = base.reader.AttributeCount; for (int i = 0; i < attributeCount; i++) { base.reader.MoveToAttribute(i); string namespaceURI = base.reader.NamespaceURI; string localName = base.reader.LocalName; if (Ref.Equal(namespaceURI, base.SchemaNames.NsXmlNs)) { if (XdrBuilder.IsXdrSchema(base.reader.Value)) { base.reader.MoveToElement(); return(ValidationType.XDR); } } else { if (Ref.Equal(namespaceURI, base.SchemaNames.NsXsi)) { base.reader.MoveToElement(); return(ValidationType.Schema); } if (Ref.Equal(namespaceURI, base.SchemaNames.QnDtDt.Namespace) && Ref.Equal(localName, base.SchemaNames.QnDtDt.Name)) { base.reader.SchemaTypeObject = XmlSchemaDatatype.FromXdrName(base.reader.Value); base.reader.MoveToElement(); return(ValidationType.XDR); } } } if (attributeCount > 0) { base.reader.MoveToElement(); } } return(ValidationType.Auto); }