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

◆ PreprocessParticle()

void System.Xml.Schema.Preprocessor.PreprocessParticle ( XmlSchemaParticle particle)
inlineprivate

Definition at line 1733 of file Preprocessor.cs.

1734 {
1735 if (particle is XmlSchemaAll)
1736 {
1737 if (particle.MinOccurs != 0m && particle.MinOccurs != 1m)
1738 {
1741 }
1742 if (particle.MaxOccurs != 1m)
1743 {
1746 }
1747 XmlSchemaObjectCollection items = ((XmlSchemaAll)particle).Items;
1748 for (int i = 0; i < items.Count; i++)
1749 {
1750 XmlSchemaElement xmlSchemaElement = (XmlSchemaElement)items[i];
1751 if (xmlSchemaElement.MaxOccurs != 0m && xmlSchemaElement.MaxOccurs != 1m)
1752 {
1755 }
1756 SetParent(xmlSchemaElement, particle);
1758 }
1759 }
1760 else
1761 {
1762 if (particle.MinOccurs > particle.MaxOccurs)
1763 {
1764 particle.MinOccurs = particle.MaxOccurs;
1766 }
1767 if (particle is XmlSchemaChoice)
1768 {
1769 XmlSchemaObjectCollection items = ((XmlSchemaChoice)particle).Items;
1770 for (int j = 0; j < items.Count; j++)
1771 {
1772 SetParent(items[j], particle);
1773 if (items[j] is XmlSchemaElement element)
1774 {
1775 PreprocessLocalElement(element);
1776 }
1777 else
1778 {
1779 PreprocessParticle((XmlSchemaParticle)items[j]);
1780 }
1781 }
1782 }
1783 else if (particle is XmlSchemaSequence)
1784 {
1785 XmlSchemaObjectCollection items = ((XmlSchemaSequence)particle).Items;
1786 for (int k = 0; k < items.Count; k++)
1787 {
1788 SetParent(items[k], particle);
1789 if (items[k] is XmlSchemaElement element2)
1790 {
1792 }
1793 else
1794 {
1795 PreprocessParticle((XmlSchemaParticle)items[k]);
1796 }
1797 }
1798 }
1799 else if (particle is XmlSchemaGroupRef)
1800 {
1801 XmlSchemaGroupRef xmlSchemaGroupRef = (XmlSchemaGroupRef)particle;
1802 if (xmlSchemaGroupRef.RefName.IsEmpty)
1803 {
1805 }
1806 else
1807 {
1809 }
1810 }
1811 else if (particle is XmlSchemaAny)
1812 {
1813 try
1814 {
1815 ((XmlSchemaAny)particle).BuildNamespaceList(_targetNamespace);
1816 }
1817 catch (FormatException ex)
1818 {
1819 SendValidationEvent(System.SR.Sch_InvalidAnyDetailed, new string[1] { ex.Message }, ex, particle);
1820 }
1821 }
1822 }
1823 PreprocessAnnotation(particle);
1824 ValidateIdAttribute(particle);
1825 }
static string Sch_MinGtMax
Definition SR.cs:834
static string Sch_MissAttribute
Definition SR.cs:428
static string Sch_InvalidAllMin
Definition SR.cs:864
static string Sch_InvalidAllElementMax
Definition SR.cs:936
static string Sch_InvalidAllMax
Definition SR.cs:866
static string Sch_InvalidAnyDetailed
Definition SR.cs:940
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void PreprocessLocalElement(XmlSchemaElement element)
void PreprocessAnnotation(XmlSchemaObject schemaObject)
void PreprocessParticle(XmlSchemaParticle particle)
void SetParent(XmlSchemaObject child, XmlSchemaObject parent)
void ValidateIdAttribute(XmlSchemaObject xso)
void ValidateQNameAttribute(XmlSchemaObject xso, string attributeName, XmlQualifiedName value)

References System.Xml.Schema.Preprocessor._targetNamespace, System.Collections.CollectionBase.Count, System.Xml.Dictionary, System.Xml.Schema.XmlSchemaParticle.MaxOccurs, System.Xml.Schema.XmlSchemaParticle.MinOccurs, System.Xml.Schema.Preprocessor.PreprocessAnnotation(), System.Xml.Schema.Preprocessor.PreprocessLocalElement(), System.Xml.Schema.Preprocessor.PreprocessParticle(), System.SR.Sch_InvalidAllElementMax, System.SR.Sch_InvalidAllMax, System.SR.Sch_InvalidAllMin, System.SR.Sch_InvalidAnyDetailed, System.SR.Sch_MinGtMax, System.SR.Sch_MissAttribute, System.Xml.Schema.BaseProcessor.SendValidationEvent(), System.Xml.Schema.Preprocessor.SetParent(), System.Xml.Schema.Preprocessor.ValidateIdAttribute(), and System.Xml.Schema.Preprocessor.ValidateQNameAttribute().

Referenced by System.Xml.Schema.Preprocessor.PreprocessComplexType(), System.Xml.Schema.Preprocessor.PreprocessGroup(), and System.Xml.Schema.Preprocessor.PreprocessParticle().