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

◆ CompileComplexType()

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

Definition at line 730 of file Compiler.cs.

731 {
732 if (complexType.ElementDecl != null)
733 {
734 return;
735 }
736 if (complexType.IsProcessing)
737 {
739 return;
740 }
742 try
743 {
744 if (complexType.ContentModel != null)
745 {
746 if (complexType.ContentModel is XmlSchemaSimpleContent)
747 {
748 XmlSchemaSimpleContent xmlSchemaSimpleContent = (XmlSchemaSimpleContent)complexType.ContentModel;
749 complexType.SetContentType(XmlSchemaContentType.TextOnly);
750 if (xmlSchemaSimpleContent.Content is XmlSchemaSimpleContentExtension)
751 {
752 CompileSimpleContentExtension(complexType, (XmlSchemaSimpleContentExtension)xmlSchemaSimpleContent.Content);
753 }
754 else
755 {
756 CompileSimpleContentRestriction(complexType, (XmlSchemaSimpleContentRestriction)xmlSchemaSimpleContent.Content);
757 }
758 }
759 else
760 {
761 XmlSchemaComplexContent xmlSchemaComplexContent = (XmlSchemaComplexContent)complexType.ContentModel;
762 if (xmlSchemaComplexContent.Content is XmlSchemaComplexContentExtension)
763 {
765 }
766 else
767 {
769 }
770 }
771 }
772 else
773 {
774 complexType.SetBaseSchemaType(XmlSchemaComplexType.AnyType);
775 CompileLocalAttributes(XmlSchemaComplexType.AnyType, complexType, complexType.Attributes, complexType.AnyAttribute, XmlSchemaDerivationMethod.Restriction);
776 complexType.SetDerivedBy(XmlSchemaDerivationMethod.Restriction);
777 complexType.SetContentTypeParticle(CompileContentTypeParticle(complexType.Particle));
778 complexType.SetContentType(GetSchemaContentType(complexType, null, complexType.ContentTypeParticle));
779 }
780 if (complexType.ContainsIdAttribute(findAll: true))
781 {
783 }
784 SchemaElementDecl schemaElementDecl = new SchemaElementDecl();
789 schemaElementDecl.Block = complexType.BlockResolved;
791 foreach (XmlSchemaAttribute value in complexType.AttributeUses.Values)
792 {
793 if (value.Use == XmlSchemaUse.Prohibited)
794 {
795 if (!schemaElementDecl.ProhibitedAttributes.ContainsKey(value.QualifiedName))
796 {
797 schemaElementDecl.ProhibitedAttributes.Add(value.QualifiedName, value.QualifiedName);
798 }
799 }
800 else if (!schemaElementDecl.AttDefs.ContainsKey(value.QualifiedName) && value.AttDef != null && value.AttDef.Name != XmlQualifiedName.Empty && value.AttDef != SchemaAttDef.Empty)
801 {
802 schemaElementDecl.AddAttDef(value.AttDef);
803 }
804 }
806 }
807 finally
808 {
810 }
811 }
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)
Definition Compiler.cs:993
ContentValidator CompileComplexContent(XmlSchemaComplexType complexType)
Definition Compiler.cs:2520
void CompileComplexContentExtension(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaComplexContentExtension complexExtension)
Definition Compiler.cs:932
void CompileSimpleContentRestriction(XmlSchemaComplexType complexType, XmlSchemaSimpleContentRestriction simpleRestriction)
Definition Compiler.cs:852
void CompileLocalAttributes(XmlSchemaComplexType baseType, XmlSchemaComplexType derivedType, XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaDerivationMethod derivedBy)
Definition Compiler.cs:1907
XmlSchemaContentType GetSchemaContentType(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaParticle particle)
Definition Compiler.cs:1828
XmlSchemaParticle CompileContentTypeParticle(XmlSchemaParticle particle)
Definition Compiler.cs:1092
void CompileSimpleContentExtension(XmlSchemaComplexType complexType, XmlSchemaSimpleContentExtension simpleExtension)
Definition Compiler.cs:813

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

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