System.Xml.Schema.SchemaCollectionCompiler.CompileComplexContentExtension C# (CSharp) Méthode

CompileComplexContentExtension() private méthode

private CompileComplexContentExtension ( XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaComplexContentExtension complexExtension ) : void
complexType XmlSchemaComplexType
complexContent XmlSchemaComplexContent
complexExtension XmlSchemaComplexContentExtension
Résultat void
        private void CompileComplexContentExtension(XmlSchemaComplexType complexType, XmlSchemaComplexContent complexContent, XmlSchemaComplexContentExtension complexExtension) {
            XmlSchemaComplexType baseType = null;
            if (complexType.Redefined != null && complexExtension.BaseTypeName == complexType.Redefined.QualifiedName) {
                baseType = (XmlSchemaComplexType)complexType.Redefined;
                CompileComplexType(baseType);
            }
            else {
                baseType = GetComplexType(complexExtension.BaseTypeName);
                if (baseType == null) {
                    SendValidationEvent(Res.Sch_UndefBaseExtension, complexExtension.BaseTypeName.ToString(), complexExtension);   
                    return;
                }
            }
            if (baseType != null && baseType.ElementDecl != null) {
                if (baseType.ContentType == XmlSchemaContentType.TextOnly) {
                    SendValidationEvent(Res.Sch_NotComplexContent, complexType);
                    return;
                }
            }
            complexType.SetBaseSchemaType(baseType);
            if ((baseType.FinalResolved & XmlSchemaDerivationMethod.Extension) != 0) {
                SendValidationEvent(Res.Sch_BaseFinalExtension, complexType);
            }
            CompileLocalAttributes(baseType, complexType, complexExtension.Attributes, complexExtension.AnyAttribute, XmlSchemaDerivationMethod.Extension);

            XmlSchemaParticle baseParticle = baseType.ContentTypeParticle;
            XmlSchemaParticle extendedParticle = CannonicalizeParticle(complexExtension.Particle, true, true);
            if (baseParticle != XmlSchemaParticle.Empty) {
                if (extendedParticle != XmlSchemaParticle.Empty) {
                    XmlSchemaSequence compiledParticle = new XmlSchemaSequence();
                    compiledParticle.Items.Add(baseParticle);
                    compiledParticle.Items.Add(extendedParticle);
                    complexType.SetContentTypeParticle(CompileContentTypeParticle(compiledParticle, false));
                }
                else {
                    complexType.SetContentTypeParticle(baseParticle);
                }
                XmlSchemaContentType contentType = GetSchemaContentType(complexType, complexContent, extendedParticle);
                if (contentType == XmlSchemaContentType.Empty) { //Derived content type is empty, Get ContentType from base
                    contentType = baseType.ContentType;
                }
                complexType.SetContentType(contentType);
                if (complexType.ContentType != baseType.ContentType) {
                    SendValidationEvent(Res.Sch_DifContentType, complexType);
                }
            }
            else {
                complexType.SetContentTypeParticle(extendedParticle);
                complexType.SetContentType(GetSchemaContentType(complexType, complexContent, complexType.ContentTypeParticle));
            }
            complexType.SetDerivedBy(XmlSchemaDerivationMethod.Extension);
        }