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

◆ PreprocessRedefine()

void System.Xml.Schema.Preprocessor.PreprocessRedefine ( RedefineEntry redefineEntry)
inlineprivate

Definition at line 715 of file Preprocessor.cs.

716 {
717 XmlSchemaRedefine redefine = redefineEntry.redefine;
718 XmlSchema schema = redefine.Schema;
721 if (schema.IsRedefined)
722 {
724 return;
725 }
726 schema.IsRedefined = true;
727 XmlSchema schemaToUpdate = redefineEntry.schemaToUpdate;
730 string @namespace = ((schemaToUpdate.TargetNamespace == null) ? string.Empty : schemaToUpdate.TargetNamespace);
731 XmlSchemaObjectCollection items = redefine.Items;
732 for (int i = 0; i < items.Count; i++)
733 {
734 SetParent(items[i], redefine);
735 if (items[i] is XmlSchemaGroup xmlSchemaGroup)
736 {
738 xmlSchemaGroup.QualifiedName.SetNamespace(@namespace);
739 if (redefine.Groups[xmlSchemaGroup.QualifiedName] != null)
740 {
742 continue;
743 }
744 AddToTable(redefine.Groups, xmlSchemaGroup.QualifiedName, xmlSchemaGroup);
745 XmlSchemaGroup xmlSchemaGroup2 = (XmlSchemaGroup)schemaToUpdate.Groups[xmlSchemaGroup.QualifiedName];
748 {
750 continue;
751 }
753 schemaToUpdate.Groups.Insert(xmlSchemaGroup.QualifiedName, xmlSchemaGroup);
755 }
756 else if (items[i] is XmlSchemaAttributeGroup)
757 {
758 XmlSchemaAttributeGroup xmlSchemaAttributeGroup = (XmlSchemaAttributeGroup)items[i];
760 xmlSchemaAttributeGroup.QualifiedName.SetNamespace(@namespace);
761 if (redefine.AttributeGroups[xmlSchemaAttributeGroup.QualifiedName] != null)
762 {
764 continue;
765 }
766 AddToTable(redefine.AttributeGroups, xmlSchemaAttributeGroup.QualifiedName, xmlSchemaAttributeGroup);
767 XmlSchemaAttributeGroup xmlSchemaAttributeGroup2 = (XmlSchemaAttributeGroup)schemaToUpdate.AttributeGroups[xmlSchemaAttributeGroup.QualifiedName];
770 {
772 continue;
773 }
775 schemaToUpdate.AttributeGroups.Insert(xmlSchemaAttributeGroup.QualifiedName, xmlSchemaAttributeGroup);
777 }
778 else if (items[i] is XmlSchemaComplexType)
779 {
780 XmlSchemaComplexType xmlSchemaComplexType = (XmlSchemaComplexType)items[i];
782 xmlSchemaComplexType.QualifiedName.SetNamespace(@namespace);
783 if (redefine.SchemaTypes[xmlSchemaComplexType.QualifiedName] != null)
784 {
786 continue;
787 }
788 AddToTable(redefine.SchemaTypes, xmlSchemaComplexType.QualifiedName, xmlSchemaComplexType);
789 XmlSchemaType xmlSchemaType = (XmlSchemaType)schemaToUpdate.SchemaTypes[xmlSchemaComplexType.QualifiedName];
792 {
794 }
795 else if (xmlSchemaType is XmlSchemaComplexType)
796 {
798 schemaToUpdate.SchemaTypes.Insert(xmlSchemaComplexType.QualifiedName, xmlSchemaComplexType);
800 }
801 else
802 {
804 }
805 }
806 else
807 {
808 if (!(items[i] is XmlSchemaSimpleType))
809 {
810 continue;
811 }
812 XmlSchemaSimpleType xmlSchemaSimpleType = (XmlSchemaSimpleType)items[i];
814 xmlSchemaSimpleType.QualifiedName.SetNamespace(@namespace);
815 if (redefine.SchemaTypes[xmlSchemaSimpleType.QualifiedName] != null)
816 {
818 continue;
819 }
820 AddToTable(redefine.SchemaTypes, xmlSchemaSimpleType.QualifiedName, xmlSchemaSimpleType);
821 XmlSchemaType xmlSchemaType2 = (XmlSchemaType)schemaToUpdate.SchemaTypes[xmlSchemaSimpleType.QualifiedName];
824 {
826 }
827 else if (xmlSchemaType2 is XmlSchemaSimpleType)
828 {
830 schemaToUpdate.SchemaTypes.Insert(xmlSchemaSimpleType.QualifiedName, xmlSchemaSimpleType);
832 }
833 else
834 {
836 }
837 }
838 }
839 }
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
static string Sch_ComponentRedefineNotFound
Definition SR.cs:804
static string Sch_SimpleTypeDoubleRedefine
Definition SR.cs:818
static string Sch_MultipleRedefine
Definition SR.cs:1154
static string Sch_SimpleToComplexTypeRedefine
Definition SR.cs:816
static string Sch_ComplexToSimpleTypeRedefine
Definition SR.cs:820
static string Sch_GroupDoubleRedefine
Definition SR.cs:802
static string Sch_ComplexTypeDoubleRedefine
Definition SR.cs:812
static string Sch_AttrGroupDoubleRedefine
Definition SR.cs:808
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void AddToTable(XmlSchemaObjectTable table, XmlQualifiedName qname, XmlSchemaObject item)
void CheckRefinedComplexType(XmlSchemaComplexType ctype)
void CheckRefinedGroup(XmlSchemaGroup group)
void SetSchemaDefaults(XmlSchema schema)
static XmlSchema GetParentSchema(XmlSchemaObject currentSchemaObject)
void SetParent(XmlSchemaObject child, XmlSchemaObject parent)
void CheckRefinedSimpleType(XmlSchemaSimpleType stype)
void PreprocessSimpleType(XmlSchemaSimpleType simpleType, bool local)
void PreprocessGroup(XmlSchemaGroup group)
void GetIncludedSet(XmlSchema schema, ArrayList includesList)
void CheckRefinedAttributeGroup(XmlSchemaAttributeGroup attributeGroup)
void PreprocessComplexType(XmlSchemaComplexType complexType, bool local)
void PreprocessAttributeGroup(XmlSchemaAttributeGroup attributeGroup)

References System.Xml.Schema.Preprocessor._currentSchema, System.Xml.Schema.BaseProcessor.AddToTable(), System.Xml.Schema.XmlSchema.AttributeGroups, System.Xml.Schema.XmlSchemaRedefine.AttributeGroups, System.Xml.Schema.Preprocessor.CheckRefinedAttributeGroup(), System.Xml.Schema.Preprocessor.CheckRefinedComplexType(), System.Xml.Schema.Preprocessor.CheckRefinedGroup(), System.Xml.Schema.Preprocessor.CheckRefinedSimpleType(), System.Collections.Generic.Dictionary< TKey, TValue >.Contains(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.Schema.Preprocessor.GetIncludedSet(), System.Xml.Schema.Preprocessor.GetParentSchema(), System.Xml.Schema.XmlSchema.Groups, System.Xml.Schema.XmlSchemaRedefine.Groups, System.Xml.Schema.XmlSchemaObjectTable.Insert(), System.Xml.Schema.XmlSchemaRedefine.Items, System.Xml.Schema.Preprocessor.PreprocessAttributeGroup(), System.Xml.Schema.Preprocessor.PreprocessComplexType(), System.Xml.Schema.Preprocessor.PreprocessGroup(), System.Xml.Schema.Preprocessor.PreprocessSimpleType(), System.SR.Sch_AttrGroupDoubleRedefine, System.SR.Sch_ComplexToSimpleTypeRedefine, System.SR.Sch_ComplexTypeDoubleRedefine, System.SR.Sch_ComponentRedefineNotFound, System.SR.Sch_GroupDoubleRedefine, System.SR.Sch_MultipleRedefine, System.SR.Sch_SimpleToComplexTypeRedefine, System.SR.Sch_SimpleTypeDoubleRedefine, System.Xml.Schema.XmlSchemaExternal.Schema, System.Xml.Schema.XmlSchema.SchemaTypes, System.Xml.Schema.XmlSchemaRedefine.SchemaTypes, System.Xml.Schema.BaseProcessor.SendValidationEvent(), System.Xml.Schema.Preprocessor.SetParent(), System.Xml.Schema.Preprocessor.SetSchemaDefaults(), and System.Xml.Schema.XmlSchema.TargetNamespace.

Referenced by System.Xml.Schema.Preprocessor.Execute().