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

◆ ReadAttributes()

override void System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadAttributes ( XmlReaderDelegator xmlReader)
inlinepackagevirtual

Reimplemented from System.Runtime.Serialization.XmlObjectSerializerReadContext.

Definition at line 129 of file XmlObjectSerializerReadContextComplexJson.cs.

130 {
131 if (attributes == null)
132 {
133 attributes = new Attributes();
134 }
136 if (xmlReader.MoveToAttribute("type") && xmlReader.Value == "null")
137 {
138 attributes.XsiNil = true;
139 }
140 else if (xmlReader.MoveToAttribute("__type"))
141 {
142 XmlQualifiedName xmlQualifiedName = JsonReaderDelegator.ParseQualifiedName(xmlReader.Value);
144 string text = xmlQualifiedName.Namespace;
145 if (!string.IsNullOrEmpty(text))
146 {
147 switch (text[0])
148 {
149 case '#':
150 text = "http://schemas.datacontract.org/2004/07/" + text.AsSpan(1);
151 break;
152 case '\\':
153 if (text.Length >= 2)
154 {
155 char c = text[1];
156 if (c == '#' || c == '\\')
157 {
158 text = text.Substring(1);
159 }
160 }
161 break;
162 }
163 }
165 }
166 xmlReader.MoveToElement();
167 }

References System.Runtime.Serialization.XmlObjectSerializerReadContext.attributes, System.Runtime.Serialization.Dictionary, System.Runtime.Serialization.Json.JsonReaderDelegator.ParseQualifiedName(), System.Runtime.Serialization.Attributes.Reset(), and System.text.