private void BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)
{
if (particle is XmlSchemaElement)
{
XmlSchemaElement element = (XmlSchemaElement) particle;
contentValidator.AddName(element.QualifiedName, element);
}
else if (particle is XmlSchemaAny)
{
XmlSchemaAny any = (XmlSchemaAny) particle;
contentValidator.AddNamespaceList(any.NamespaceList, any);
}
else if (particle is XmlSchemaGroupBase)
{
XmlSchemaObjectCollection items = ((XmlSchemaGroupBase) particle).Items;
bool flag = particle is XmlSchemaChoice;
contentValidator.OpenGroup();
bool flag2 = true;
for (int i = 0; i < items.Count; i++)
{
XmlSchemaParticle particle2 = (XmlSchemaParticle) items[i];
if (flag2)
{
flag2 = false;
}
else if (flag)
{
contentValidator.AddChoice();
}
else
{
contentValidator.AddSequence();
}
this.BuildParticleContentModel(contentValidator, particle2);
}
contentValidator.CloseGroup();
}
if ((particle.MinOccurs != 1M) || (particle.MaxOccurs != 1M))
{
if ((particle.MinOccurs == 0M) && (particle.MaxOccurs == 1M))
{
contentValidator.AddQMark();
}
else if ((particle.MinOccurs == 0M) && (particle.MaxOccurs == 79228162514264337593543950335M))
{
contentValidator.AddStar();
}
else if ((particle.MinOccurs == 1M) && (particle.MaxOccurs == 79228162514264337593543950335M))
{
contentValidator.AddPlus();
}
else
{
contentValidator.AddLeafRange(particle.MinOccurs, particle.MaxOccurs);
}
}
}