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

◆ GetSchemaItem()

static string System.Xml.Serialization.XmlSchemas.GetSchemaItem ( XmlSchemaObject o,
string ns,
string details )
inlinestaticprivate

Definition at line 544 of file XmlSchemas.cs.

545 {
546 if (o == null)
547 {
548 return null;
549 }
550 while (o.Parent != null && !(o.Parent is XmlSchema))
551 {
552 o = o.Parent;
553 }
554 if (ns == null || ns.Length == 0)
555 {
557 while (xmlSchemaObject.Parent != null)
558 {
560 }
562 {
563 ns = ((XmlSchema)xmlSchemaObject).TargetNamespace;
564 }
565 }
566 string text = null;
568 {
569 return System.SR.Format(System.SR.XmlSchemaNamedItem, ns, "notation", ((XmlSchemaNotation)o).Name, details);
570 }
571 if (o is XmlSchemaGroup)
572 {
573 return System.SR.Format(System.SR.XmlSchemaNamedItem, ns, "group", ((XmlSchemaGroup)o).Name, details);
574 }
576 {
578 if (xmlSchemaElement.Name == null || xmlSchemaElement.Name.Length == 0)
579 {
580 XmlQualifiedName parentName = GetParentName(o);
581 return System.SR.Format(System.SR.XmlSchemaElementReference, xmlSchemaElement.RefName.ToString(), parentName.Name, parentName.Namespace);
582 }
583 return System.SR.Format(System.SR.XmlSchemaNamedItem, ns, "element", xmlSchemaElement.Name, details);
584 }
585 if (o is XmlSchemaType)
586 {
587 return System.SR.Format(System.SR.XmlSchemaNamedItem, ns, (o.GetType() == typeof(XmlSchemaSimpleType)) ? "simpleType" : "complexType", ((XmlSchemaType)o).Name, null);
588 }
590 {
591 return System.SR.Format(System.SR.XmlSchemaNamedItem, ns, "attributeGroup", ((XmlSchemaAttributeGroup)o).Name, details);
592 }
594 {
596 if (xmlSchemaAttribute.Name == null || xmlSchemaAttribute.Name.Length == 0)
597 {
598 XmlQualifiedName parentName2 = GetParentName(o);
600 }
601 return System.SR.Format(System.SR.XmlSchemaNamedItem, ns, "attribute", xmlSchemaAttribute.Name, details);
602 }
604 {
605 XmlQualifiedName parentName3 = GetParentName(o);
606 return System.SR.Format(System.SR.XmlSchemaContentDef, parentName3.Name, parentName3.Namespace, null);
607 }
609 {
610 string p = ((o is XmlSchemaImport) ? "import" : ((o is XmlSchemaInclude) ? "include" : ((o is XmlSchemaRedefine) ? "redefine" : o.GetType().Name)));
611 return System.SR.Format(System.SR.XmlSchemaItem, ns, p, details);
612 }
613 if (o is XmlSchema)
614 {
615 return System.SR.Format(System.SR.XmlSchema, ns, details);
616 }
617 return System.SR.Format(System.SR.XmlSchemaNamedItem, ns, o.GetType().Name, null, details);
618 }
static string XmlSchemaNamedItem
Definition SR.cs:1784
static string XmlSchemaContentDef
Definition SR.cs:1786
static string XmlSchemaItem
Definition SR.cs:1782
static string XmlSchemaElementReference
Definition SR.cs:1778
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string XmlSchemaAttributeReference
Definition SR.cs:1780
static string XmlSchema
Definition SR.cs:1788
Definition SR.cs:7
static XmlQualifiedName GetParentName(XmlSchemaObject item)

References System.Xml.Dictionary, System.SR.Format(), System.Xml.Serialization.XmlSchemas.GetParentName(), System.Xml.Name, System.text, System.Xml.Serialization.XmlSchemas.XmlSchema, System.SR.XmlSchema, System.SR.XmlSchemaAttributeReference, System.SR.XmlSchemaContentDef, System.SR.XmlSchemaElementReference, System.SR.XmlSchemaItem, and System.SR.XmlSchemaNamedItem.

Referenced by System.Xml.Serialization.XmlSchemas.CreateValidationException(), and System.Xml.Serialization.XmlSchemas.MergeFailedMessage().