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

◆ IsValidRestriction()

bool System.Xml.Schema.Compiler.IsValidRestriction ( XmlSchemaParticle derivedParticle,
XmlSchemaParticle baseParticle )
inlineprivate

Definition at line 1368 of file Compiler.cs.

1369 {
1371 {
1372 return true;
1373 }
1374 if (derivedParticle == null || derivedParticle == XmlSchemaParticle.Empty)
1375 {
1377 }
1378 if (baseParticle == null || baseParticle == XmlSchemaParticle.Empty)
1379 {
1380 return false;
1381 }
1382 if (derivedParticle is XmlSchemaElement)
1383 {
1384 XmlSchemaElement element = (XmlSchemaElement)derivedParticle;
1386 }
1387 if (baseParticle is XmlSchemaElement)
1388 {
1389 XmlSchemaElement xmlSchemaElement = (XmlSchemaElement)baseParticle;
1391 if (xmlSchemaParticle is XmlSchemaChoice)
1392 {
1394 }
1395 if (derivedParticle is XmlSchemaElement)
1396 {
1397 return IsElementFromElement((XmlSchemaElement)derivedParticle, xmlSchemaElement);
1398 }
1400 return false;
1401 }
1402 if (baseParticle is XmlSchemaAny)
1403 {
1404 if (derivedParticle is XmlSchemaElement)
1405 {
1406 return IsElementFromAny((XmlSchemaElement)derivedParticle, (XmlSchemaAny)baseParticle);
1407 }
1408 if (derivedParticle is XmlSchemaAny)
1409 {
1410 return IsAnyFromAny((XmlSchemaAny)derivedParticle, (XmlSchemaAny)baseParticle);
1411 }
1412 return IsGroupBaseFromAny((XmlSchemaGroupBase)derivedParticle, (XmlSchemaAny)baseParticle);
1413 }
1414 if (baseParticle is XmlSchemaAll)
1415 {
1416 if (derivedParticle is XmlSchemaElement)
1417 {
1418 return IsElementFromGroupBase((XmlSchemaElement)derivedParticle, (XmlSchemaGroupBase)baseParticle);
1419 }
1420 if (derivedParticle is XmlSchemaAll)
1421 {
1422 if (IsGroupBaseFromGroupBase((XmlSchemaGroupBase)derivedParticle, (XmlSchemaGroupBase)baseParticle, skipEmptableOnly: true))
1423 {
1424 return true;
1425 }
1426 }
1427 else if (derivedParticle is XmlSchemaSequence)
1428 {
1429 if (IsSequenceFromAll((XmlSchemaSequence)derivedParticle, (XmlSchemaAll)baseParticle))
1430 {
1431 return true;
1432 }
1434 }
1435 else if (derivedParticle is XmlSchemaChoice || derivedParticle is XmlSchemaAny)
1436 {
1438 }
1439 return false;
1440 }
1441 if (baseParticle is XmlSchemaChoice)
1442 {
1443 if (derivedParticle is XmlSchemaElement)
1444 {
1445 return IsElementFromGroupBase((XmlSchemaElement)derivedParticle, (XmlSchemaGroupBase)baseParticle);
1446 }
1447 if (derivedParticle is XmlSchemaChoice)
1448 {
1449 XmlSchemaChoice xmlSchemaChoice = baseParticle as XmlSchemaChoice;
1450 XmlSchemaChoice xmlSchemaChoice2 = derivedParticle as XmlSchemaChoice;
1451 if (xmlSchemaChoice.Parent == null || xmlSchemaChoice2.Parent == null)
1452 {
1454 }
1456 {
1457 return true;
1458 }
1459 }
1460 else if (derivedParticle is XmlSchemaSequence)
1461 {
1462 if (IsSequenceFromChoice((XmlSchemaSequence)derivedParticle, (XmlSchemaChoice)baseParticle))
1463 {
1464 return true;
1465 }
1467 }
1468 else
1469 {
1471 }
1472 return false;
1473 }
1474 if (baseParticle is XmlSchemaSequence)
1475 {
1476 if (derivedParticle is XmlSchemaElement)
1477 {
1478 return IsElementFromGroupBase((XmlSchemaElement)derivedParticle, (XmlSchemaGroupBase)baseParticle);
1479 }
1480 if (derivedParticle is XmlSchemaSequence || (derivedParticle is XmlSchemaAll && ((XmlSchemaGroupBase)derivedParticle).Items.Count == 1))
1481 {
1482 if (IsGroupBaseFromGroupBase((XmlSchemaGroupBase)derivedParticle, (XmlSchemaGroupBase)baseParticle, skipEmptableOnly: true))
1483 {
1484 return true;
1485 }
1486 }
1487 else
1488 {
1490 }
1491 return false;
1492 }
1493 return false;
1494 }
static string Sch_SeqFromChoice
Definition SR.cs:1030
static string Sch_ForbiddenDerivedParticleForElem
Definition SR.cs:994
static string Sch_ForbiddenDerivedParticleForAll
Definition SR.cs:992
static string Sch_ForbiddenDerivedParticleForChoice
Definition SR.cs:996
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Sch_ForbiddenDerivedParticleForSeq
Definition SR.cs:998
static string Sch_SeqFromAll
Definition SR.cs:1028
Definition SR.cs:7
XmlSchemaParticle CannonicalizeElement(XmlSchemaElement element)
Definition Compiler.cs:1135
bool IsGroupBaseFromAny(XmlSchemaGroupBase derivedGroupBase, XmlSchemaAny baseAny)
Definition Compiler.cs:1543
bool IsSequenceFromAll(XmlSchemaSequence derivedSequence, XmlSchemaAll baseAll)
Definition Compiler.cs:1660
bool IsSequenceFromChoice(XmlSchemaSequence derivedSequence, XmlSchemaChoice baseChoice)
Definition Compiler.cs:1691
bool IsElementFromElement(XmlSchemaElement derivedElement, XmlSchemaElement baseElement)
Definition Compiler.cs:1496
bool IsElementFromGroupBase(XmlSchemaElement derivedElement, XmlSchemaGroupBase baseGroupBase)
Definition Compiler.cs:1566
bool IsValidRestriction(XmlSchemaParticle derivedParticle, XmlSchemaParticle baseParticle)
Definition Compiler.cs:1368
bool IsParticleEmptiable(XmlSchemaParticle particle)
Definition Compiler.cs:1735
bool IsChoiceFromChoiceSubstGroup(XmlSchemaChoice derivedChoice, XmlSchemaChoice baseChoice)
Definition Compiler.cs:1607
bool IsElementFromAny(XmlSchemaElement derivedElement, XmlSchemaAny baseAny)
Definition Compiler.cs:1508
bool IsAnyFromAny(XmlSchemaAny derivedAny, XmlSchemaAny baseAny)
Definition Compiler.cs:1523
bool IsGroupBaseFromGroupBase(XmlSchemaGroupBase derivedGroupBase, XmlSchemaGroupBase baseGroupBase, bool skipEmptableOnly)
Definition Compiler.cs:1624

References System.Xml.Schema.Compiler._restrictionErrorMsg, System.Xml.Schema.Compiler.CannonicalizeElement(), System.Xml.Dictionary, System.Xml.Schema.XmlSchemaParticle.Empty, System.SR.Format(), System.Globalization.NumberFormatInfo.InvariantInfo, System.Xml.Schema.Compiler.IsAnyFromAny(), System.Xml.Schema.Compiler.IsChoiceFromChoiceSubstGroup(), System.Xml.Schema.Compiler.IsElementFromAny(), System.Xml.Schema.Compiler.IsElementFromElement(), System.Xml.Schema.Compiler.IsElementFromGroupBase(), System.Xml.Schema.Compiler.IsGroupBaseFromAny(), System.Xml.Schema.Compiler.IsGroupBaseFromGroupBase(), System.Xml.Schema.Compiler.IsParticleEmptiable(), System.Xml.Schema.Compiler.IsSequenceFromAll(), System.Xml.Schema.Compiler.IsSequenceFromChoice(), System.Xml.Schema.Compiler.IsValidRestriction(), System.SR.Sch_ForbiddenDerivedParticleForAll, System.SR.Sch_ForbiddenDerivedParticleForChoice, System.SR.Sch_ForbiddenDerivedParticleForElem, System.SR.Sch_ForbiddenDerivedParticleForSeq, System.SR.Sch_SeqFromAll, and System.SR.Sch_SeqFromChoice.

Referenced by System.Xml.Schema.Compiler.CheckParticleDerivation(), System.Xml.Schema.Compiler.CheckParticleDerivation(), System.Xml.Schema.Compiler.GetMappingParticle(), System.Xml.Schema.Compiler.IsGroupBaseFromAny(), System.Xml.Schema.Compiler.IsGroupBaseFromGroupBase(), and System.Xml.Schema.Compiler.IsValidRestriction().