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

◆ FindDatasetElement()

XmlSchemaElement System.Data.XSDSchema.FindDatasetElement ( XmlSchemaObjectCollection elements)
inlineprivate

Definition at line 527 of file XSDSchema.cs.

528 {
529 foreach (XmlSchemaElement element in elements)
530 {
531 if (GetBooleanAttribute(element, "IsDataSet", defVal: false))
532 {
533 return element;
534 }
535 }
536 if (elements.Count == 1 || (FromInference && elements.Count > 0))
537 {
540 {
541 return null;
542 }
544 if (xmlSchemaComplexType == null)
545 {
546 return null;
547 }
548 while (xmlSchemaComplexType != null)
549 {
550 if (HasAttributes(xmlSchemaComplexType.Attributes))
551 {
552 return null;
553 }
555 {
556 XmlSchemaAnnotated content = ((XmlSchemaSimpleContent)xmlSchemaComplexType.ContentModel).Content;
558 {
561 {
562 return null;
563 }
564 }
565 else
566 {
569 {
570 return null;
571 }
572 }
573 }
575 if (particle != null && !IsDatasetParticle(particle))
576 {
577 return null;
578 }
579 if (!(xmlSchemaComplexType.BaseXmlSchemaType is XmlSchemaComplexType))
580 {
581 break;
582 }
584 }
585 return xmlSchemaElement2;
586 }
587 return null;
588 }
bool HasAttributes(XmlSchemaObjectCollection attributes)
Definition XSDSchema.cs:465
XmlSchemaParticle GetParticle(XmlSchemaComplexType ct)
bool GetBooleanAttribute(XmlSchemaAnnotated element, string attrName, bool defVal)
bool IsDatasetParticle(XmlSchemaParticle pt)
Definition XSDSchema.cs:485

References System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Dictionary, System.Data.XSDSchema.FromInference, System.Data.XSDSchema.GetBooleanAttribute(), System.Data.XSDSchema.GetParticle(), System.Data.XSDSchema.HasAttributes(), and System.Data.XSDSchema.IsDatasetParticle().

Referenced by System.Data.XSDSchema.LoadSchema().