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

◆ AddItem()

XmlSchemaObject System.Xml.Serialization.SchemaObjectCache.AddItem ( XmlSchemaObject item,
XmlQualifiedName qname,
XmlSchemas schemas )
inlinepackage

Definition at line 68 of file SchemaObjectCache.cs.

69 {
70 if (item == null)
71 {
72 return null;
73 }
74 if (qname == null || qname.IsEmpty)
75 {
76 return null;
77 }
78 string key = item.GetType().Name + ":" + qname.ToString();
80 if (arrayList == null)
81 {
82 arrayList = new ArrayList();
84 }
85 for (int i = 0; i < arrayList.Count; i++)
86 {
88 if (xmlSchemaObject == item)
89 {
90 return xmlSchemaObject;
91 }
93 {
94 return xmlSchemaObject;
95 }
96 Warnings.Add(System.SR.Format(System.SR.XmlMismatchSchemaObjects, item.GetType().Name, qname.Name, qname.Namespace));
97 Warnings.Add("DEBUG:Cached item key:\r\n" + (string)looks[xmlSchemaObject] + "\r\nnew item key:\r\n" + (string)looks[item]);
98 }
99 arrayList.Add(item);
100 return item;
101 }
static string XmlMismatchSchemaObjects
Definition SR.cs:1722
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
bool Match(XmlSchemaObject o1, XmlSchemaObject o2, bool shareTypes)

References System.Collections.Specialized.StringCollection.Add(), System.Xml.Dictionary, System.SR.Format(), System.Xml.XmlQualifiedName.IsEmpty, System.item, System.key, System.Xml.Serialization.SchemaObjectCache.looks, System.Xml.Serialization.SchemaObjectCache.Match(), System.Xml.XmlQualifiedName.Name, System.Xml.XmlQualifiedName.Namespace, System.Xml.Serialization.SchemaObjectCache.ObjectCache, System.Xml.XmlQualifiedName.ToString(), System.Xml.Serialization.SchemaObjectCache.Warnings, and System.SR.XmlMismatchSchemaObjects.