internal void Add(SchemaInfo sinfo, ValidationEventHandler eventhandler) { if (this.schemaType == System.Xml.Schema.SchemaType.None) { this.schemaType = sinfo.SchemaType; } else if (this.schemaType != sinfo.SchemaType) { if (eventhandler != null) { eventhandler(this, new ValidationEventArgs(new XmlSchemaException("Sch_MixSchemaTypes", string.Empty))); } return; } foreach (string str in sinfo.TargetNamespaces.Keys) { if (!this.targetNamespaces.ContainsKey(str)) { this.targetNamespaces.Add(str, true); } } foreach (KeyValuePair<XmlQualifiedName, SchemaElementDecl> pair in sinfo.elementDecls) { if (!this.elementDecls.ContainsKey(pair.Key)) { this.elementDecls.Add(pair.Key, pair.Value); } } foreach (KeyValuePair<XmlQualifiedName, SchemaElementDecl> pair2 in sinfo.elementDeclsByType) { if (!this.elementDeclsByType.ContainsKey(pair2.Key)) { this.elementDeclsByType.Add(pair2.Key, pair2.Value); } } foreach (SchemaAttDef def in sinfo.AttributeDecls.Values) { if (!this.attributeDecls.ContainsKey(def.Name)) { this.attributeDecls.Add(def.Name, def); } } foreach (SchemaNotation notation in sinfo.Notations.Values) { if (!this.Notations.ContainsKey(notation.Name.Name)) { this.Notations.Add(notation.Name.Name, notation); } } }
internal void Add(SchemaInfo sinfo, ValidationEventHandler eventhandler) { if (this.schemaType == System.Xml.Schema.SchemaType.None) { this.schemaType = sinfo.SchemaType; } else if (this.schemaType != sinfo.SchemaType) { if (eventhandler != null) { eventhandler(this, new ValidationEventArgs(new XmlSchemaException("Sch_MixSchemaTypes", string.Empty))); } return; } foreach (string str in sinfo.TargetNamespaces.Keys) { if (!this.targetNamespaces.ContainsKey(str)) { this.targetNamespaces.Add(str, true); } } foreach (KeyValuePair <XmlQualifiedName, SchemaElementDecl> pair in sinfo.elementDecls) { if (!this.elementDecls.ContainsKey(pair.Key)) { this.elementDecls.Add(pair.Key, pair.Value); } } foreach (KeyValuePair <XmlQualifiedName, SchemaElementDecl> pair2 in sinfo.elementDeclsByType) { if (!this.elementDeclsByType.ContainsKey(pair2.Key)) { this.elementDeclsByType.Add(pair2.Key, pair2.Value); } } foreach (SchemaAttDef def in sinfo.AttributeDecls.Values) { if (!this.attributeDecls.ContainsKey(def.Name)) { this.attributeDecls.Add(def.Name, def); } } foreach (SchemaNotation notation in sinfo.Notations.Values) { if (!this.Notations.ContainsKey(notation.Name.Name)) { this.Notations.Add(notation.Name.Name, notation); } } }