System.Xml.Schema.XmlSchemaComplexType.HasParticleRef C# (CSharp) Méthode

HasParticleRef() static private méthode

static private HasParticleRef ( XmlSchemaParticle particle ) : bool
particle XmlSchemaParticle
Résultat bool
        internal static bool HasParticleRef(XmlSchemaParticle particle) {
            XmlSchemaGroupBase groupBase = particle as XmlSchemaGroupBase;
            if (groupBase != null && ! (groupBase is XmlSchemaAll)) {
                bool foundRef = false;
                int i = 0;
                while (i < groupBase.Items.Count && !foundRef) {
                    XmlSchemaParticle p = (XmlSchemaParticle)groupBase.Items[i++];
                    if (p is XmlSchemaGroupRef) {
                        foundRef = true;
                    }
                    else {
                        XmlSchemaElement elem = p as XmlSchemaElement;
                        if (elem != null && (!elem.RefName.IsEmpty || !elem.SchemaTypeName.IsEmpty)) {
                            foundRef = true;
                        }
                        else {
                            foundRef = HasParticleRef(p);
                        }
                    }
                }
                return foundRef;
            }
            else if (particle is XmlSchemaGroupRef) {
                return true;
            }
            return false;
        }

Usage Example

Exemple #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);
        }
All Usage Examples Of System.Xml.Schema.XmlSchemaComplexType::HasParticleRef