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

◆ PreprocessParticle()

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

Definition at line 1483 of file SchemaCollectionPreprocessor.cs.

1484 {
1485 if (particle is XmlSchemaAll xmlSchemaAll)
1486 {
1487 if (particle.MinOccurs != 0m && particle.MinOccurs != 1m)
1488 {
1491 }
1492 if (particle.MaxOccurs != 1m)
1493 {
1496 }
1497 for (int i = 0; i < xmlSchemaAll.Items.Count; i++)
1498 {
1499 XmlSchemaElement xmlSchemaElement = (XmlSchemaElement)xmlSchemaAll.Items[i];
1500 if (xmlSchemaElement.MaxOccurs != 0m && xmlSchemaElement.MaxOccurs != 1m)
1501 {
1504 }
1505 SetParent(xmlSchemaElement, particle);
1507 }
1508 }
1509 else
1510 {
1511 if (particle.MinOccurs > particle.MaxOccurs)
1512 {
1513 particle.MinOccurs = particle.MaxOccurs;
1515 }
1516 if (particle is XmlSchemaChoice xmlSchemaChoice)
1517 {
1518 XmlSchemaObjectCollection items = xmlSchemaChoice.Items;
1519 for (int j = 0; j < items.Count; j++)
1520 {
1521 SetParent(items[j], particle);
1522 if (items[j] is XmlSchemaElement element)
1523 {
1524 PreprocessLocalElement(element);
1525 }
1526 else
1527 {
1528 PreprocessParticle((XmlSchemaParticle)items[j]);
1529 }
1530 }
1531 }
1532 else if (particle is XmlSchemaSequence)
1533 {
1534 XmlSchemaObjectCollection items2 = ((XmlSchemaSequence)particle).Items;
1535 for (int k = 0; k < items2.Count; k++)
1536 {
1537 SetParent(items2[k], particle);
1538 if (items2[k] is XmlSchemaElement element2)
1539 {
1541 }
1542 else
1543 {
1544 PreprocessParticle((XmlSchemaParticle)items2[k]);
1545 }
1546 }
1547 }
1548 else if (particle is XmlSchemaGroupRef)
1549 {
1550 XmlSchemaGroupRef xmlSchemaGroupRef = (XmlSchemaGroupRef)particle;
1551 if (xmlSchemaGroupRef.RefName.IsEmpty)
1552 {
1554 }
1555 else
1556 {
1558 }
1559 }
1560 else if (particle is XmlSchemaAny)
1561 {
1562 try
1563 {
1564 ((XmlSchemaAny)particle).BuildNamespaceListV1Compat(_targetNamespace);
1565 }
1566 catch
1567 {
1569 }
1570 }
1571 }
1572 PreprocessAnnotation(particle);
1573 ValidateIdAttribute(particle);
1574 }
static string Sch_MinGtMax
Definition SR.cs:834
static string Sch_InvalidAny
Definition SR.cs:938
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
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void SetParent(XmlSchemaObject child, XmlSchemaObject parent)
void ValidateQNameAttribute(XmlSchemaObject xso, string attributeName, XmlQualifiedName value)

References System.Xml.Schema.SchemaCollectionPreprocessor._targetNamespace, System.Collections.CollectionBase.Count, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Xml.Schema.XmlSchemaParticle.MaxOccurs, System.Xml.Schema.XmlSchemaParticle.MinOccurs, System.Xml.Schema.SchemaCollectionPreprocessor.PreprocessAnnotation(), System.Xml.Schema.SchemaCollectionPreprocessor.PreprocessLocalElement(), System.Xml.Schema.SchemaCollectionPreprocessor.PreprocessParticle(), System.SR.Sch_InvalidAllElementMax, System.SR.Sch_InvalidAllMax, System.SR.Sch_InvalidAllMin, System.SR.Sch_InvalidAny, System.SR.Sch_MinGtMax, System.SR.Sch_MissAttribute, System.Xml.Schema.BaseProcessor.SendValidationEvent(), System.Xml.Schema.SchemaCollectionPreprocessor.SetParent(), System.Xml.Schema.SchemaCollectionPreprocessor.ValidateIdAttribute(), and System.Xml.Schema.SchemaCollectionPreprocessor.ValidateQNameAttribute().

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