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

◆ AddScopeElement()

void System.Xml.Serialization.XmlSchemaImporter.AddScopeElement ( INameScope scope,
ElementAccessor element,
ref bool duplicateElements,
bool allowDuplicates )
inlineprivate

Definition at line 966 of file XmlSchemaImporter.cs.

967 {
968 if (scope == null)
969 {
970 return;
971 }
972 ElementAccessor elementAccessor = (ElementAccessor)scope[element.Name, element.Namespace];
973 if (elementAccessor != null)
974 {
975 if (!allowDuplicates)
976 {
977 throw new InvalidOperationException(System.SR.Format(System.SR.XmlDuplicateElementInScope, element.Name, element.Namespace));
978 }
979 if (elementAccessor.Mapping.TypeDesc != element.Mapping.TypeDesc)
980 {
981 throw new InvalidOperationException(System.SR.Format(System.SR.XmlDuplicateElementInScope1, element.Name, element.Namespace));
982 }
983 duplicateElements = true;
984 }
985 else
986 {
987 scope[element.Name, element.Namespace] = element;
988 }
989 }
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlDuplicateElementInScope1
Definition SR.cs:1710
static string XmlDuplicateElementInScope
Definition SR.cs:1708
Definition SR.cs:7

References System.SR.Format(), System.Xml.Serialization.Accessor.Mapping, System.Xml.Serialization.Accessor.Name, System.Xml.Serialization.Accessor.Namespace, System.Xml.Serialization.TypeMapping.TypeDesc, System.SR.XmlDuplicateElementInScope, and System.SR.XmlDuplicateElementInScope1.

Referenced by System.Xml.Serialization.XmlSchemaImporter.AddScopeElements(), System.Xml.Serialization.XmlSchemaImporter.GatherGroupChoices(), and System.Xml.Serialization.XmlSchemaImporter.ImportElementMember().