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

◆ PreprocessComplexType()

void System.Xml.Schema.Preprocessor.PreprocessComplexType ( XmlSchemaComplexType complexType,
bool local )
inlineprivate

Definition at line 1469 of file Preprocessor.cs.

1470 {
1471 if (local)
1472 {
1473 if (complexType.Name != null)
1474 {
1476 }
1477 }
1478 else
1479 {
1480 if (complexType.Name != null)
1481 {
1483 complexType.SetQualifiedName(new XmlQualifiedName(complexType.Name, _targetNamespace));
1484 }
1485 else
1486 {
1488 }
1489 if (complexType.Block == XmlSchemaDerivationMethod.All)
1490 {
1491 complexType.SetBlockResolved(XmlSchemaDerivationMethod.All);
1492 }
1493 else if (complexType.Block == XmlSchemaDerivationMethod.None)
1494 {
1495 complexType.SetBlockResolved(_blockDefault & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1496 }
1497 else
1498 {
1499 if (((uint)complexType.Block & 0xFFFFFFF9u) != 0)
1500 {
1502 }
1503 complexType.SetBlockResolved(complexType.Block & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1504 }
1505 if (complexType.Final == XmlSchemaDerivationMethod.All)
1506 {
1507 complexType.SetFinalResolved(XmlSchemaDerivationMethod.All);
1508 }
1509 else if (complexType.Final == XmlSchemaDerivationMethod.None)
1510 {
1511 if (_finalDefault == XmlSchemaDerivationMethod.All)
1512 {
1513 complexType.SetFinalResolved(XmlSchemaDerivationMethod.All);
1514 }
1515 else
1516 {
1517 complexType.SetFinalResolved(_finalDefault & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1518 }
1519 }
1520 else
1521 {
1522 if (((uint)complexType.Final & 0xFFFFFFF9u) != 0)
1523 {
1525 }
1526 complexType.SetFinalResolved(complexType.Final & (XmlSchemaDerivationMethod.Extension | XmlSchemaDerivationMethod.Restriction));
1527 }
1528 }
1529 if (complexType.ContentModel != null)
1530 {
1531 SetParent(complexType.ContentModel, complexType);
1532 PreprocessAnnotation(complexType.ContentModel);
1533 if (complexType.Particle == null)
1534 {
1535 _ = complexType.Attributes;
1536 }
1537 if (complexType.ContentModel is XmlSchemaSimpleContent)
1538 {
1539 XmlSchemaSimpleContent xmlSchemaSimpleContent = (XmlSchemaSimpleContent)complexType.ContentModel;
1540 if (xmlSchemaSimpleContent.Content == null)
1541 {
1542 if (complexType.QualifiedName == XmlQualifiedName.Empty)
1543 {
1545 }
1546 else
1547 {
1548 SendValidationEvent(System.SR.Sch_NoRestOrExtQName, complexType.QualifiedName.Name, complexType.QualifiedName.Namespace, complexType);
1549 }
1550 }
1551 else
1552 {
1555 if (xmlSchemaSimpleContent.Content is XmlSchemaSimpleContentExtension)
1556 {
1557 XmlSchemaSimpleContentExtension xmlSchemaSimpleContentExtension = (XmlSchemaSimpleContentExtension)xmlSchemaSimpleContent.Content;
1558 if (xmlSchemaSimpleContentExtension.BaseTypeName.IsEmpty)
1559 {
1561 }
1562 else
1563 {
1565 }
1568 }
1569 else
1570 {
1571 XmlSchemaSimpleContentRestriction xmlSchemaSimpleContentRestriction = (XmlSchemaSimpleContentRestriction)xmlSchemaSimpleContent.Content;
1572 if (xmlSchemaSimpleContentRestriction.BaseTypeName.IsEmpty)
1573 {
1575 }
1576 else
1577 {
1579 }
1580 if (xmlSchemaSimpleContentRestriction.BaseType != null)
1581 {
1584 }
1587 }
1588 }
1590 }
1591 else
1592 {
1593 XmlSchemaComplexContent xmlSchemaComplexContent = (XmlSchemaComplexContent)complexType.ContentModel;
1594 if (xmlSchemaComplexContent.Content == null)
1595 {
1596 if (complexType.QualifiedName == XmlQualifiedName.Empty)
1597 {
1599 }
1600 else
1601 {
1602 SendValidationEvent(System.SR.Sch_NoRestOrExtQName, complexType.QualifiedName.Name, complexType.QualifiedName.Namespace, complexType);
1603 }
1604 }
1605 else
1606 {
1607 if (!xmlSchemaComplexContent.HasMixedAttribute && complexType.IsMixed)
1608 {
1610 }
1613 if (xmlSchemaComplexContent.Content is XmlSchemaComplexContentExtension)
1614 {
1615 XmlSchemaComplexContentExtension xmlSchemaComplexContentExtension = (XmlSchemaComplexContentExtension)xmlSchemaComplexContent.Content;
1616 if (xmlSchemaComplexContentExtension.BaseTypeName.IsEmpty)
1617 {
1619 }
1620 else
1621 {
1623 }
1624 if (xmlSchemaComplexContentExtension.Particle != null)
1625 {
1628 }
1631 }
1632 else
1633 {
1634 XmlSchemaComplexContentRestriction xmlSchemaComplexContentRestriction = (XmlSchemaComplexContentRestriction)xmlSchemaComplexContent.Content;
1635 if (xmlSchemaComplexContentRestriction.BaseTypeName.IsEmpty)
1636 {
1638 }
1639 else
1640 {
1642 }
1643 if (xmlSchemaComplexContentRestriction.Particle != null)
1644 {
1647 }
1650 }
1652 }
1653 }
1654 }
1655 else
1656 {
1657 if (complexType.Particle != null)
1658 {
1661 }
1662 PreprocessAttributes(complexType.Attributes, complexType.AnyAttribute, complexType);
1663 }
1665 }
static string Sch_InvalidComplexTypeBlockValue
Definition SR.cs:516
static string Sch_InvalidComplexTypeFinalValue
Definition SR.cs:518
static string Sch_NoRestOrExtQName
Definition SR.cs:858
static string Sch_MissAttribute
Definition SR.cs:428
static string Sch_NoRestOrExt
Definition SR.cs:860
static string Sch_ForbiddenAttribute
Definition SR.cs:544
static string Sch_MissRequiredAttribute
Definition SR.cs:490
Definition SR.cs:7
void SendValidationEvent(string code, XmlSchemaObject source)
void PreprocessAnnotation(XmlSchemaObject schemaObject)
void PreprocessAttributes(XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaObject parent)
void ValidateNameAttribute(XmlSchemaObject xso)
XmlSchemaDerivationMethod _blockDefault
void PreprocessParticle(XmlSchemaParticle particle)
void SetParent(XmlSchemaObject child, XmlSchemaObject parent)
void PreprocessSimpleType(XmlSchemaSimpleType simpleType, bool local)
void ValidateIdAttribute(XmlSchemaObject xso)
XmlSchemaDerivationMethod _finalDefault
void ValidateQNameAttribute(XmlSchemaObject xso, string attributeName, XmlQualifiedName value)

References System.Xml.Schema.Preprocessor._blockDefault, System.Xml.Schema.Preprocessor._finalDefault, System.Xml.Schema.Preprocessor._targetNamespace, System.Xml.Dictionary, System.Xml.XmlQualifiedName.Empty, System.Xml.Schema.Preprocessor.PreprocessAnnotation(), System.Xml.Schema.Preprocessor.PreprocessAttributes(), System.Xml.Schema.Preprocessor.PreprocessParticle(), System.Xml.Schema.Preprocessor.PreprocessSimpleType(), System.SR.Sch_ForbiddenAttribute, System.SR.Sch_InvalidComplexTypeBlockValue, System.SR.Sch_InvalidComplexTypeFinalValue, System.SR.Sch_MissAttribute, System.SR.Sch_MissRequiredAttribute, System.SR.Sch_NoRestOrExt, System.SR.Sch_NoRestOrExtQName, System.Xml.Schema.BaseProcessor.SendValidationEvent(), System.Xml.Schema.Preprocessor.SetParent(), System.Xml.Schema.Preprocessor.ValidateIdAttribute(), System.Xml.Schema.Preprocessor.ValidateNameAttribute(), and System.Xml.Schema.Preprocessor.ValidateQNameAttribute().

Referenced by System.Xml.Schema.Preprocessor.Preprocess(), System.Xml.Schema.Preprocessor.PreprocessElementContent(), and System.Xml.Schema.Preprocessor.PreprocessRedefine().