Esempio n. 1
0
        internal XmlSchemaObject Clone(XmlSchema parentSchema)
        {
            XmlSchemaGroup newGroup = (XmlSchemaGroup)MemberwiseClone();

            if (XmlSchemaComplexType.HasParticleRef(_particle, parentSchema))
            {
                newGroup._particle = XmlSchemaComplexType.CloneParticle(_particle, parentSchema) as XmlSchemaGroupBase;
            }
            newGroup._canonicalParticle = XmlSchemaParticle.Empty;
            return(newGroup);
        }
Esempio n. 2
0
        private bool IsValidGroupRedefine(XmlSchemaObject existingObject, XmlSchemaObject item, XmlSchemaObjectTable table)
        {
            XmlSchemaGroup group         = item as XmlSchemaGroup;
            XmlSchemaGroup existingGroup = existingObject as XmlSchemaGroup;

            if (existingGroup == group.Redefined)
            {                                                 //group is the redefinition of existingObject
                if (existingGroup.CanonicalParticle == null)
                {                                             //If the existing one is not already compiled, then replace.
                    table.Insert(group.QualifiedName, group); //Update with redefined entry
                    return(true);
                }
            }
            else if (existingGroup.Redefined == group)
            { //Redefined type already exists in the set, original type is added after redefined type, ignore the original type
                return(true);
            }
            return(false);
        }