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

◆ ExportSpecialMapping()

XmlSchemaType System.Xml.Serialization.XmlSchemaExporter.ExportSpecialMapping ( SpecialMapping mapping,
string ns,
bool isAny,
XmlSchemaElement element )
inlineprivate

Definition at line 465 of file XmlSchemaExporter.cs.

466 {
467 switch (mapping.TypeDesc.Kind)
468 {
469 case TypeKind.Node:
470 {
472 xmlSchemaComplexType4.IsMixed = mapping.TypeDesc.IsMixed;
475 if (isAny)
476 {
479 xmlSchemaAny3.MaxOccurs = decimal.MaxValue;
480 }
483 if (element != null)
484 {
486 }
488 }
489 case TypeKind.Serializable:
490 {
491 SerializableMapping serializableMapping = (SerializableMapping)mapping;
492 if (serializableMapping.IsAny)
493 {
495 xmlSchemaComplexType.IsMixed = mapping.TypeDesc.IsMixed;
498 if (isAny)
499 {
502 xmlSchemaAny.MaxOccurs = decimal.MaxValue;
503 }
504 if (serializableMapping.NamespaceList.Length > 0)
505 {
507 }
509 if (serializableMapping.Schemas != null)
510 {
511 foreach (XmlSchema item in serializableMapping.Schemas.Schemas())
512 {
513 if (item.TargetNamespace != "http://www.w3.org/2001/XMLSchema")
514 {
516 AddSchemaImport(item.TargetNamespace, ns);
517 }
518 }
519 }
522 if (element != null)
523 {
525 }
527 }
528 if (serializableMapping.XsiType != null || serializableMapping.XsdType != null)
529 {
531 foreach (XmlSchema item2 in serializableMapping.Schemas.Schemas())
532 {
533 if (item2.TargetNamespace != "http://www.w3.org/2001/XMLSchema")
534 {
536 AddSchemaImport(item2.TargetNamespace, ns);
537 if (!serializableMapping.XsiType.IsEmpty && serializableMapping.XsiType.Namespace == item2.TargetNamespace)
538 {
540 }
541 }
542 }
543 if (element != null)
544 {
546 if (element.SchemaTypeName.IsEmpty)
547 {
549 }
550 }
551 serializableMapping.CheckDuplicateElement(element, ns);
552 return xmlSchemaType;
553 }
554 if (serializableMapping.Schema != null)
555 {
561 string targetNamespace = serializableMapping.Schema.TargetNamespace;
564 if (xmlSchema3 == null)
565 {
567 }
568 else if (xmlSchema3 != serializableMapping.Schema)
569 {
571 }
572 if (element != null)
573 {
575 }
576 serializableMapping.CheckDuplicateElement(element, ns);
578 }
581 xmlSchemaElement.RefName = new XmlQualifiedName("schema", "http://www.w3.org/2001/XMLSchema");
584 xmlSchemaSequence3.Items.Add(new XmlSchemaAny());
586 AddSchemaImport("http://www.w3.org/2001/XMLSchema", ns);
587 if (element != null)
588 {
590 }
592 }
593 default:
594 throw new ArgumentException(System.SR.XmlInternalError, "mapping");
595 }
596 }
static string XmlInternalError
Definition SR.cs:1812
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlDuplicateNamespace
Definition SR.cs:1480
Definition SR.cs:7
void AddSchemaImport(string ns, string referencingNs)
int Add(XmlSchema schema, bool delay)

References System.Xml.Serialization.XmlSchemaExporter._schemas, System.Xml.Serialization.XmlSchemas.Add(), System.Xml.Serialization.XmlSchemaExporter.AddSchemaImport(), System.Xml.ArgumentException, System.delay, System.Xml.Dictionary, System.SR.Format(), System.Xml.XmlQualifiedName.IsEmpty, System.item, System.Xml.Schema.XmlSchemaElement.SchemaTypeName, System.SR.XmlDuplicateNamespace, and System.SR.XmlInternalError.

Referenced by System.Xml.Serialization.XmlSchemaExporter.ExportElementMapping(), System.Xml.Serialization.XmlSchemaExporter.ExportMapping(), System.Xml.Serialization.XmlSchemaExporter.ExportRootIfNecessary(), and System.Xml.Serialization.XmlSchemaExporter.ExportTypeMapping().