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

◆ CalculateEffectiveTotalRange()

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

Definition at line 1741 of file Compiler.cs.

1742 {
1743 XmlSchemaChoice xmlSchemaChoice = particle as XmlSchemaChoice;
1744 if (particle is XmlSchemaElement || particle is XmlSchemaAny)
1745 {
1746 minOccurs = particle.MinOccurs;
1747 maxOccurs = particle.MaxOccurs;
1748 return;
1749 }
1750 if (xmlSchemaChoice != null)
1751 {
1752 if (xmlSchemaChoice.Items.Count == 0)
1753 {
1754 minOccurs = (maxOccurs = 0m);
1755 return;
1756 }
1757 minOccurs = decimal.MaxValue;
1758 maxOccurs = default(decimal);
1759 for (int i = 0; i < xmlSchemaChoice.Items.Count; i++)
1760 {
1762 if (minOccurs2 < minOccurs)
1763 {
1765 }
1766 if (maxOccurs2 > maxOccurs)
1767 {
1769 }
1770 }
1771 minOccurs *= particle.MinOccurs;
1772 if (maxOccurs != decimal.MaxValue)
1773 {
1774 if (particle.MaxOccurs == decimal.MaxValue)
1775 {
1776 maxOccurs = decimal.MaxValue;
1777 }
1778 else
1779 {
1780 maxOccurs *= particle.MaxOccurs;
1781 }
1782 }
1783 return;
1784 }
1785 XmlSchemaObjectCollection items = ((XmlSchemaGroupBase)particle).Items;
1786 if (items.Count == 0)
1787 {
1788 minOccurs = (maxOccurs = 0m);
1789 return;
1790 }
1791 minOccurs = default(decimal);
1792 maxOccurs = default(decimal);
1793 for (int j = 0; j < items.Count; j++)
1794 {
1795 CalculateEffectiveTotalRange((XmlSchemaParticle)items[j], out var minOccurs3, out var maxOccurs3);
1797 if (maxOccurs != decimal.MaxValue)
1798 {
1799 if (maxOccurs3 == decimal.MaxValue)
1800 {
1801 maxOccurs = decimal.MaxValue;
1802 }
1803 else
1804 {
1806 }
1807 }
1808 }
1809 minOccurs *= particle.MinOccurs;
1810 if (maxOccurs != decimal.MaxValue)
1811 {
1812 if (particle.MaxOccurs == decimal.MaxValue)
1813 {
1814 maxOccurs = decimal.MaxValue;
1815 }
1816 else
1817 {
1818 maxOccurs *= particle.MaxOccurs;
1819 }
1820 }
1821 }
void CalculateEffectiveTotalRange(XmlSchemaParticle particle, out decimal minOccurs, out decimal maxOccurs)
Definition Compiler.cs:1741

References System.Xml.Schema.Compiler.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.Compiler.CalculateEffectiveTotalRange(), System.Xml.Schema.Compiler.IsGroupBaseFromAny(), and System.Xml.Schema.Compiler.IsParticleEmptiable().