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

◆ CalculateEffectiveTotalRange()

void System.Xml.Schema.SchemaCollectionCompiler.CalculateEffectiveTotalRange ( XmlSchemaParticle particle,
out decimal minOccurs,
out decimal maxOccurs )
inlineprivate

Definition at line 1497 of file SchemaCollectionCompiler.cs.

1498 {
1499 if (particle is XmlSchemaElement || particle is XmlSchemaAny)
1500 {
1501 minOccurs = particle.MinOccurs;
1502 maxOccurs = particle.MaxOccurs;
1503 return;
1504 }
1505 if (particle is XmlSchemaChoice)
1506 {
1507 if (((XmlSchemaChoice)particle).Items.Count == 0)
1508 {
1509 minOccurs = (maxOccurs = 0m);
1510 return;
1511 }
1512 minOccurs = decimal.MaxValue;
1513 maxOccurs = default(decimal);
1514 XmlSchemaChoice xmlSchemaChoice = (XmlSchemaChoice)particle;
1515 for (int i = 0; i < xmlSchemaChoice.Items.Count; i++)
1516 {
1518 if (minOccurs2 < minOccurs)
1519 {
1521 }
1522 if (maxOccurs2 > maxOccurs)
1523 {
1525 }
1526 }
1527 minOccurs *= particle.MinOccurs;
1528 if (maxOccurs != decimal.MaxValue)
1529 {
1530 if (particle.MaxOccurs == decimal.MaxValue)
1531 {
1532 maxOccurs = decimal.MaxValue;
1533 }
1534 else
1535 {
1536 maxOccurs *= particle.MaxOccurs;
1537 }
1538 }
1539 return;
1540 }
1541 XmlSchemaObjectCollection items = ((XmlSchemaGroupBase)particle).Items;
1542 if (items.Count == 0)
1543 {
1544 minOccurs = (maxOccurs = 0m);
1545 return;
1546 }
1547 minOccurs = default(decimal);
1548 maxOccurs = default(decimal);
1549 for (int j = 0; j < items.Count; j++)
1550 {
1551 CalculateEffectiveTotalRange((XmlSchemaParticle)items[j], out var minOccurs3, out var maxOccurs3);
1553 if (maxOccurs != decimal.MaxValue)
1554 {
1555 if (maxOccurs3 == decimal.MaxValue)
1556 {
1557 maxOccurs = decimal.MaxValue;
1558 }
1559 else
1560 {
1562 }
1563 }
1564 }
1565 minOccurs *= particle.MinOccurs;
1566 if (maxOccurs != decimal.MaxValue)
1567 {
1568 if (particle.MaxOccurs == decimal.MaxValue)
1569 {
1570 maxOccurs = decimal.MaxValue;
1571 }
1572 else
1573 {
1574 maxOccurs *= particle.MaxOccurs;
1575 }
1576 }
1577 }
void CalculateEffectiveTotalRange(XmlSchemaParticle particle, out decimal minOccurs, out decimal maxOccurs)

References System.Xml.Schema.SchemaCollectionCompiler.CalculateEffectiveTotalRange(), System.Collections.CollectionBase.Count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.Schema.XmlSchemaParticle.MaxOccurs, and System.Xml.Schema.XmlSchemaParticle.MinOccurs.

Referenced by System.Xml.Schema.SchemaCollectionCompiler.CalculateEffectiveTotalRange(), System.Xml.Schema.SchemaCollectionCompiler.IsGroupBaseFromAny(), and System.Xml.Schema.SchemaCollectionCompiler.IsParticleEmptiable().