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

◆ ImportSchemaType() [3/3]

XmlTypeMapping System.Xml.Serialization.XmlSchemaImporter.ImportSchemaType ( XmlQualifiedName typeName,
Type? baseType,
bool baseTypeCanBeIndirect )
inline

Definition at line 96 of file XmlSchemaImporter.cs.

97 {
98 TypeMapping typeMapping = ImportType(typeName, typeof(TypeMapping), baseType, TypeFlags.CanBeElementValue, addref: true);
100 ElementAccessor elementAccessor = new ElementAccessor();
102 elementAccessor.Name = typeName.Name;
103 elementAccessor.Namespace = typeName.Namespace;
105 if (typeMapping is SpecialMapping && ((SpecialMapping)typeMapping).NamedAny)
106 {
107 elementAccessor.Any = true;
108 }
109 elementAccessor.IsNullable = typeMapping.TypeDesc.IsNullable;
111 if (elementAccessor.Mapping is StructMapping)
112 {
114 }
115 else if (baseType != null)
116 {
117 if (!(elementAccessor.Mapping is ArrayMapping))
118 {
119 throw new InvalidOperationException(System.SR.Format(System.SR.XmlBadBaseType, typeName.Name, typeName.Namespace, baseType.FullName));
120 }
121 elementAccessor.Mapping = ((ArrayMapping)elementAccessor.Mapping).TopLevelMapping;
123 }
124 return new XmlTypeMapping(base.Scope, elementAccessor);
125 }
static string XmlBadBaseType
Definition SR.cs:1638
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
void MakeDerived(StructMapping structMapping, Type baseType, bool baseTypeCanBeIndirect)
TypeMapping ImportType(XmlQualifiedName name, Type desiredMappingType, Type baseType, TypeFlags flags, bool addref)

References System.Xml.Dictionary, System.SR.Format(), System.Xml.Serialization.XmlSchemaImporter.ImportType(), System.Xml.Serialization.SchemaImporter.MakeDerived(), System.Xml.XmlQualifiedName.Name, System.Xml.XmlQualifiedName.Namespace, and System.SR.XmlBadBaseType.