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

◆ CompileComplexType()

void System.Xml.Schema.SchemaCollectionCompiler.CompileComplexType ( XmlSchemaComplexType complexType)
inlineprivate

Definition at line 642 of file SchemaCollectionCompiler.cs.

643 {
644 if (complexType.ElementDecl != null)
645 {
646 return;
647 }
648 if (complexType.IsProcessing)
649 {
651 return;
652 }
654 if (complexType.ContentModel != null)
655 {
656 if (complexType.ContentModel is XmlSchemaSimpleContent)
657 {
658 XmlSchemaSimpleContent xmlSchemaSimpleContent = (XmlSchemaSimpleContent)complexType.ContentModel;
659 complexType.SetContentType(XmlSchemaContentType.TextOnly);
660 if (xmlSchemaSimpleContent.Content is XmlSchemaSimpleContentExtension)
661 {
662 CompileSimpleContentExtension(complexType, (XmlSchemaSimpleContentExtension)xmlSchemaSimpleContent.Content);
663 }
664 else
665 {
666 CompileSimpleContentRestriction(complexType, (XmlSchemaSimpleContentRestriction)xmlSchemaSimpleContent.Content);
667 }
668 }
669 else
670 {
671 XmlSchemaComplexContent xmlSchemaComplexContent = (XmlSchemaComplexContent)complexType.ContentModel;
672 if (xmlSchemaComplexContent.Content is XmlSchemaComplexContentExtension)
673 {
675 }
676 else
677 {
679 }
680 }
681 }
682 else
683 {
684 complexType.SetBaseSchemaType(XmlSchemaComplexType.AnyType);
685 CompileLocalAttributes(XmlSchemaComplexType.AnyType, complexType, complexType.Attributes, complexType.AnyAttribute, XmlSchemaDerivationMethod.Restriction);
686 complexType.SetDerivedBy(XmlSchemaDerivationMethod.Restriction);
687 complexType.SetContentTypeParticle(CompileContentTypeParticle(complexType.Particle, substitution: true));
688 complexType.SetContentType(GetSchemaContentType(complexType, null, complexType.ContentTypeParticle));
689 }
690 bool flag = false;
691 foreach (XmlSchemaAttribute value in complexType.AttributeUses.Values)
692 {
693 if (value.Use == XmlSchemaUse.Prohibited)
694 {
695 continue;
696 }
697 XmlSchemaDatatype datatype = value.Datatype;
698 if (datatype != null && datatype.TokenizedType == XmlTokenizedType.ID)
699 {
700 if (flag)
701 {
703 }
704 else
705 {
706 flag = true;
707 }
708 }
709 }
710 SchemaElementDecl schemaElementDecl = new SchemaElementDecl();
715 schemaElementDecl.Block = complexType.BlockResolved;
717 foreach (XmlSchemaAttribute value2 in complexType.AttributeUses.Values)
718 {
719 if (value2.Use == XmlSchemaUse.Prohibited)
720 {
721 if (!schemaElementDecl.ProhibitedAttributes.ContainsKey(value2.QualifiedName))
722 {
723 schemaElementDecl.ProhibitedAttributes.Add(value2.QualifiedName, value2.QualifiedName);
724 }
725 }
726 else if (!schemaElementDecl.AttDefs.ContainsKey(value2.QualifiedName) && value2.AttDef != null && value2.AttDef.Name != XmlQualifiedName.Empty && value2.AttDef != SchemaAttDef.Empty)
727 {
728 schemaElementDecl.AddAttDef(value2.AttDef);
729 }
730 }
733 }
void Add(TKey key, TValue value)
static string Sch_TypeCircularRef
Definition SR.cs:952
static string Sch_TwoIdAttrUses
Definition SR.cs:954
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void CompileComplexContentRestriction(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaComplexContentRestriction complexRestriction)
void CompileLocalAttributes(XmlSchemaComplexType baseType, XmlSchemaComplexType derivedType, XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaDerivationMethod derivedBy)
void CompileSimpleContentRestriction(XmlSchemaComplexType complexType, XmlSchemaSimpleContentRestriction simpleRestriction)
ContentValidator CompileComplexContent(XmlSchemaComplexType complexType)
void CompileSimpleContentExtension(XmlSchemaComplexType complexType, XmlSchemaSimpleContentExtension simpleExtension)
void CompileComplexContentExtension(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaComplexContentExtension complexExtension)
XmlSchemaParticle CompileContentTypeParticle(XmlSchemaParticle particle, bool substitution)
XmlSchemaContentType GetSchemaContentType(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaParticle particle)

References System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Xml.Schema.XmlSchemaComplexType.AnyType, System.Xml.Schema.SchemaCollectionCompiler.CompileComplexContent(), System.Xml.Schema.SchemaCollectionCompiler.CompileComplexContentExtension(), System.Xml.Schema.SchemaCollectionCompiler.CompileComplexContentRestriction(), System.Xml.Schema.SchemaCollectionCompiler.CompileContentTypeParticle(), System.Xml.Schema.SchemaCollectionCompiler.CompileLocalAttributes(), System.Xml.Schema.SchemaCollectionCompiler.CompileSimpleContentExtension(), System.Xml.Schema.SchemaCollectionCompiler.CompileSimpleContentRestriction(), System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.Xml.Dictionary, System.Xml.Schema.SchemaAttDef.Empty, System.Xml.XmlQualifiedName.Empty, System.Xml.Schema.SchemaCollectionCompiler.GetSchemaContentType(), System.SR.Sch_TwoIdAttrUses, System.SR.Sch_TypeCircularRef, System.Xml.Schema.BaseProcessor.SendValidationEvent(), System.Xml.Schema.XmlSchemaDatatype.TokenizedType, System.value, and System.Collections.Generic.Dictionary< TKey, TValue >.Values.

Referenced by System.Xml.Schema.SchemaCollectionCompiler.Compile(), System.Xml.Schema.SchemaCollectionCompiler.CompileComplexContentExtension(), System.Xml.Schema.SchemaCollectionCompiler.CompileComplexContentRestriction(), System.Xml.Schema.SchemaCollectionCompiler.CompileElement(), System.Xml.Schema.SchemaCollectionCompiler.CompileSimpleContentExtension(), System.Xml.Schema.SchemaCollectionCompiler.CompileSimpleContentRestriction(), System.Xml.Schema.SchemaCollectionCompiler.GetAnySchemaType(), and System.Xml.Schema.SchemaCollectionCompiler.GetComplexType().