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

◆ ImportDataType()

TypeMapping System.Xml.Serialization.XmlSchemaImporter.ImportDataType ( XmlSchemaSimpleType dataType,
string typeNs,
string identifier,
Type baseType,
TypeFlags flags,
bool isList )
inlineprivate

Definition at line 1697 of file XmlSchemaImporter.cs.

1698 {
1699 if (baseType != null)
1700 {
1701 return ImportStructDataType(dataType, typeNs, identifier, baseType);
1702 }
1703 TypeMapping typeMapping = ImportNonXsdPrimitiveDataType(dataType, typeNs, flags);
1704 if (typeMapping != null)
1705 {
1706 return typeMapping;
1707 }
1709 {
1712 {
1714 {
1715 return ImportEnumeratedDataType(dataType, typeNs, identifier, flags, isList);
1716 }
1717 }
1718 if (xmlSchemaSimpleTypeRestriction.BaseType != null)
1719 {
1720 return ImportDataType(xmlSchemaSimpleTypeRestriction.BaseType, typeNs, identifier, null, flags, isList: false);
1721 }
1724 if (xmlSchemaSimpleTypeRestriction.BaseTypeName.Namespace != "http://www.w3.org/2001/XMLSchema")
1725 {
1726 RemoveReference(xmlSchemaSimpleTypeRestriction.BaseTypeName, base.TypesInUse);
1727 }
1728 return typeMapping;
1729 }
1731 {
1732 if (dataType.Content is XmlSchemaSimpleTypeList)
1733 {
1735 if (xmlSchemaSimpleTypeList.ItemType != null)
1736 {
1737 typeMapping = ImportDataType(xmlSchemaSimpleTypeList.ItemType, typeNs, identifier, null, flags, isList: true);
1738 if (typeMapping != null)
1739 {
1740 typeMapping.TypeName = dataType.Name;
1741 return typeMapping;
1742 }
1743 }
1744 else if (xmlSchemaSimpleTypeList.ItemTypeName != null && !xmlSchemaSimpleTypeList.ItemTypeName.IsEmpty)
1745 {
1746 typeMapping = ImportType(xmlSchemaSimpleTypeList.ItemTypeName, typeof(TypeMapping), null, TypeFlags.CanBeAttributeValue, addref: true);
1747 if (typeMapping != null && typeMapping is PrimitiveMapping)
1748 {
1749 ((PrimitiveMapping)typeMapping).IsList = true;
1750 return typeMapping;
1751 }
1752 }
1753 }
1754 return GetDefaultMapping(flags);
1755 }
1756 return ImportPrimitiveDataType(dataType, flags);
1757 }
static string XmlCircularTypeReference
Definition SR.cs:1724
Definition SR.cs:7
void RemoveReference(XmlQualifiedName name, NameTable references)
void AddReference(XmlQualifiedName name, NameTable references, string error)
TypeMapping ImportType(XmlQualifiedName name, Type desiredMappingType, Type baseType, TypeFlags flags, bool addref)
XmlSchemaSimpleType FindDataType(XmlQualifiedName name, TypeFlags flags)
TypeMapping ImportEnumeratedDataType(XmlSchemaSimpleType dataType, string typeNs, string identifier, TypeFlags flags, bool isList)
TypeMapping GetDefaultMapping(TypeFlags flags)
PrimitiveMapping ImportNonXsdPrimitiveDataType(XmlSchemaSimpleType dataType, string ns, TypeFlags flags)
StructMapping ImportStructDataType(XmlSchemaSimpleType dataType, string typeNs, string identifier, Type baseType)
TypeMapping ImportDataType(XmlSchemaSimpleType dataType, string typeNs, string identifier, Type baseType, TypeFlags flags, bool isList)
PrimitiveMapping ImportPrimitiveDataType(XmlSchemaSimpleType dataType, TypeFlags flags)

References System.Xml.Serialization.SchemaImporter.AddReference(), System.Xml.Schema.XmlSchemaSimpleType.Content, System.Xml.Dictionary, System.Xml.Serialization.XmlSchemaImporter.FindDataType(), System.Xml.Serialization.XmlSchemaImporter.GetDefaultMapping(), System.Xml.Serialization.XmlSchemaImporter.ImportDataType(), System.Xml.Serialization.XmlSchemaImporter.ImportEnumeratedDataType(), System.Xml.Serialization.XmlSchemaImporter.ImportNonXsdPrimitiveDataType(), System.Xml.Serialization.XmlSchemaImporter.ImportPrimitiveDataType(), System.Xml.Serialization.XmlSchemaImporter.ImportStructDataType(), System.Xml.Serialization.XmlSchemaImporter.ImportType(), System.Xml.Serialization.TypeMapping.IsList, System.Xml.Schema.XmlSchemaType.Name, System.Xml.Serialization.SchemaImporter.RemoveReference(), and System.SR.XmlCircularTypeReference.

Referenced by System.Xml.Serialization.XmlSchemaImporter.ImportAttribute(), System.Xml.Serialization.XmlSchemaImporter.ImportDataType(), System.Xml.Serialization.XmlSchemaImporter.ImportElementType(), and System.Xml.Serialization.XmlSchemaImporter.ImportType().