internal XmlSchemaObjectCollection GetParticleItems(XmlSchemaParticle pt)
{
if (pt is XmlSchemaSequence)
return ((XmlSchemaSequence)pt).Items;
if (pt is XmlSchemaAll)
return ((XmlSchemaAll)pt).Items;
if (pt is XmlSchemaChoice)
return ((XmlSchemaChoice)pt).Items;
if (pt is XmlSchemaAny)
return null;
// the code below is a little hack for the SOM behavior
if (pt is XmlSchemaElement)
{
XmlSchemaObjectCollection Items = new XmlSchemaObjectCollection();
Items.Add(pt);
return Items;
}
if (pt is XmlSchemaGroupRef)
return GetParticleItems(((XmlSchemaGroupRef)pt).Particle);
// should never get here.
return null;
}