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

◆ ExportStructMapping()

XmlQualifiedName System.Xml.Serialization.XmlSchemaExporter.ExportStructMapping ( StructMapping mapping,
string ns,
XmlSchemaElement element )
inlineprivate

Definition at line 994 of file XmlSchemaExporter.cs.

995 {
996 if (mapping.TypeDesc.IsRoot)
997 {
998 _needToExportRoot = true;
999 return XmlQualifiedName.Empty;
1000 }
1001 if (mapping.IsAnonymousType)
1002 {
1003 if (_references[mapping] != null)
1004 {
1005 throw new InvalidOperationException(System.SR.Format(System.SR.XmlCircularReference2, mapping.TypeDesc.Name, "AnonymousType", "false"));
1006 }
1008 }
1010 if (xmlSchemaComplexType == null)
1011 {
1012 if (!mapping.IncludeInSchema)
1013 {
1015 }
1018 if (!mapping.IsAnonymousType)
1019 {
1023 }
1024 xmlSchemaComplexType.IsAbstract = mapping.TypeDesc.IsAbstract;
1025 bool openModel = mapping.IsOpenModel;
1026 if (mapping.BaseMapping != null && mapping.BaseMapping.IncludeInSchema)
1027 {
1028 if (mapping.BaseMapping.IsAnonymousType)
1029 {
1030 throw new InvalidOperationException(System.SR.Format(System.SR.XmlAnonymousBaseType, mapping.TypeDesc.Name, mapping.BaseMapping.TypeDesc.Name, "AnonymousType", "false"));
1031 }
1032 if (mapping.HasSimpleContent)
1033 {
1039 }
1040 else
1041 {
1046 xmlSchemaComplexContent.IsMixed = XmlSchemaImporter.IsMixed((XmlSchemaComplexType)_types[mapping.BaseMapping]);
1048 }
1049 openModel = false;
1050 }
1051 ExportTypeMembers(xmlSchemaComplexType, mapping.Members, mapping.TypeName, mapping.Namespace, mapping.HasSimpleContent, openModel);
1053 if (mapping.XmlnsMember != null)
1054 {
1056 }
1057 }
1058 else
1059 {
1060 AddSchemaImport(mapping.Namespace, ns);
1061 }
1062 if (mapping.IsAnonymousType)
1063 {
1064 _references[mapping] = null;
1065 if (element != null)
1066 {
1068 }
1069 return XmlQualifiedName.Empty;
1070 }
1071 XmlQualifiedName xmlQualifiedName = new XmlQualifiedName(xmlSchemaComplexType.Name, mapping.Namespace);
1072 if (element != null)
1073 {
1075 }
1076 return xmlQualifiedName;
1077 }
virtual void Add(object key, object? value)
Definition Hashtable.cs:676
static string XmlAnonymousBaseType
Definition SR.cs:1616
static string XmlCircularReference2
Definition SR.cs:1614
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlCannotIncludeInSchema
Definition SR.cs:1580
Definition SR.cs:7
void ExportDerivedMappings(StructMapping mapping)
void AddXmlnsAnnotation(XmlSchemaComplexType type, string xmlnsMemberName)
void AddSchemaImport(string ns, string referencingNs)
void AddSchemaItem(XmlSchemaObject item, string ns, string referencingNs)
void CheckForDuplicateType(TypeMapping mapping, string newNamespace)
XmlQualifiedName ExportStructMapping(StructMapping mapping, string ns, XmlSchemaElement element)
void ExportTypeMembers(XmlSchemaComplexType type, MemberMapping[] members, string name, string ns, bool hasSimpleContent, bool openModel)

References System.Xml.Serialization.XmlSchemaExporter._needToExportRoot, System.Xml.Serialization.XmlSchemaExporter._references, System.Xml.Serialization.XmlSchemaExporter._types, System.Collections.Hashtable.Add(), System.Xml.Serialization.XmlSchemaExporter.AddSchemaImport(), System.Xml.Serialization.XmlSchemaExporter.AddSchemaItem(), System.Xml.Serialization.XmlSchemaExporter.AddXmlnsAnnotation(), System.Xml.Serialization.XmlSchemaExporter.CheckForDuplicateType(), System.Xml.Dictionary, System.Xml.XmlQualifiedName.Empty, System.Xml.Serialization.XmlSchemaExporter.ExportDerivedMappings(), System.Xml.Serialization.XmlSchemaExporter.ExportStructMapping(), System.Xml.Serialization.XmlSchemaExporter.ExportTypeMembers(), System.SR.Format(), System.Xml.Serialization.XmlSchemaImporter.IsMixed(), System.SR.XmlAnonymousBaseType, System.SR.XmlCannotIncludeInSchema, and System.SR.XmlCircularReference2.

Referenced by System.Xml.Serialization.XmlSchemaExporter.ExportDerivedMappings(), System.Xml.Serialization.XmlSchemaExporter.ExportElementMapping(), System.Xml.Serialization.XmlSchemaExporter.ExportMapping(), and System.Xml.Serialization.XmlSchemaExporter.ExportStructMapping().