Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ BuildParticleContentModel()

void System.Xml.Schema.SchemaCollectionCompiler.BuildParticleContentModel ( ParticleContentValidator contentValidator,
XmlSchemaParticle particle )
inlineprivate

Definition at line 2255 of file SchemaCollectionCompiler.cs.

2256 {
2257 if (particle is XmlSchemaElement)
2258 {
2259 XmlSchemaElement xmlSchemaElement = (XmlSchemaElement)particle;
2260 contentValidator.AddName(xmlSchemaElement.QualifiedName, xmlSchemaElement);
2261 }
2262 else if (particle is XmlSchemaAny)
2263 {
2264 XmlSchemaAny xmlSchemaAny = (XmlSchemaAny)particle;
2265 contentValidator.AddNamespaceList(xmlSchemaAny.NamespaceList, xmlSchemaAny);
2266 }
2267 else if (particle is XmlSchemaGroupBase)
2268 {
2269 XmlSchemaObjectCollection items = ((XmlSchemaGroupBase)particle).Items;
2270 bool flag = particle is XmlSchemaChoice;
2271 contentValidator.OpenGroup();
2272 bool flag2 = true;
2273 for (int i = 0; i < items.Count; i++)
2274 {
2275 XmlSchemaParticle particle2 = (XmlSchemaParticle)items[i];
2276 if (flag2)
2277 {
2278 flag2 = false;
2279 }
2280 else if (flag)
2281 {
2282 contentValidator.AddChoice();
2283 }
2284 else
2285 {
2286 contentValidator.AddSequence();
2287 }
2289 }
2290 contentValidator.CloseGroup();
2291 }
2292 if (!(particle.MinOccurs == 1m) || !(particle.MaxOccurs == 1m))
2293 {
2294 if (particle.MinOccurs == 0m && particle.MaxOccurs == 1m)
2295 {
2296 contentValidator.AddQMark();
2297 }
2298 else if (particle.MinOccurs == 0m && particle.MaxOccurs == decimal.MaxValue)
2299 {
2300 contentValidator.AddStar();
2301 }
2302 else if (particle.MinOccurs == 1m && particle.MaxOccurs == decimal.MaxValue)
2303 {
2304 contentValidator.AddPlus();
2305 }
2306 else
2307 {
2308 contentValidator.AddLeafRange(particle.MinOccurs, particle.MaxOccurs);
2309 }
2310 }
2311 }
void BuildParticleContentModel(ParticleContentValidator contentValidator, XmlSchemaParticle particle)

References System.Xml.Schema.SchemaCollectionCompiler.BuildParticleContentModel(), System.Collections.CollectionBase.Count, System.Xml.Schema.XmlSchemaParticle.MaxOccurs, and System.Xml.Schema.XmlSchemaParticle.MinOccurs.

Referenced by System.Xml.Schema.SchemaCollectionCompiler.BuildParticleContentModel(), and System.Xml.Schema.SchemaCollectionCompiler.CompileComplexContent().