Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Add() [1/6]

void System.Xml.Schema.XmlSchemaSet.Add ( string targetNamespace,
XmlReader reader,
Hashtable validatedNamespaces )
inlinepackage

Definition at line 655 of file XmlSchemaSet.cs.

656 {
657 if (reader == null)
658 {
659 throw new ArgumentNullException("reader");
660 }
661 if (targetNamespace == null)
662 {
663 targetNamespace = string.Empty;
664 }
666 {
667 if (FindSchemaByNSAndUrl(new Uri(reader.BaseURI, UriKind.RelativeOrAbsolute), targetNamespace, null) == null)
668 {
669 throw new XmlSchemaException(System.SR.Sch_ComponentAlreadySeenForNS, targetNamespace);
670 }
671 }
672 else
673 {
674 if (IsSchemaLoaded(new Uri(reader.BaseURI, UriKind.RelativeOrAbsolute), targetNamespace, out var schema))
675 {
676 return;
677 }
682 if (schema.ImportedSchemas.Count <= 0)
683 {
684 return;
685 }
686 for (int i = 0; i < schema.ImportedSchemas.Count; i++)
687 {
688 XmlSchema xmlSchema = (XmlSchema)schema.ImportedSchemas[i];
689 string text = xmlSchema.TargetNamespace;
690 if (text == null)
691 {
692 text = string.Empty;
693 }
694 if (validatedNamespaces[text] != null && FindSchemaByNSAndUrl(xmlSchema.BaseUri, text, array) == null)
695 {
697 throw new XmlSchemaException(System.SR.Sch_ComponentAlreadySeenForNS, text);
698 }
699 }
700 }
701 }
virtual void CopyTo(Array array, int arrayIndex)
Definition Hashtable.cs:811
static string Sch_ComponentAlreadySeenForNS
Definition SR.cs:1164
Definition SR.cs:7
XmlSchema ParseSchema(string targetNamespace, XmlReader reader)
bool RemoveRecursive(XmlSchema schemaToRemove)
bool IsSchemaLoaded(Uri schemaUri, string targetNamespace, out XmlSchema schema)
XmlSchema FindSchemaByNSAndUrl(Uri schemaUri, string ns, DictionaryEntry[] locationsTable)
readonly Hashtable _schemaLocations
UriKind
Definition UriKind.cs:4

References System.Xml.Schema.XmlSchemaSet._schemaLocations, System.Add, System.array, System.Xml.XmlReader.BaseURI, System.Collections.Hashtable.CopyTo(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Collections.Hashtable.Count, System.Xml.Schema.XmlSchemaSet.FindSchemaByNSAndUrl(), System.Xml.Schema.XmlSchemaSet.IsSchemaLoaded(), System.Xml.Schema.XmlSchemaSet.ParseSchema(), System.Xml.Schema.XmlSchemaSet.RemoveRecursive(), System.SR.Sch_ComponentAlreadySeenForNS, and System.text.