Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlSerializableServices.cs
Go to the documentation of this file.
2using System.Xml;
4
6
7public static class XmlSerializableServices
8{
9 internal static string AddDefaultSchemaMethodName = "AddDefaultSchema";
10
12 {
13 if (xmlReader == null)
14 {
16 }
19 if (xmlReader.MoveToFirstAttribute())
20 {
21 do
22 {
24 {
26 if (xmlNode == null)
27 {
29 }
30 list.Add(xmlNode);
31 }
32 }
33 while (xmlReader.MoveToNextAttribute());
34 }
35 xmlReader.MoveToElement();
36 if (!xmlReader.IsEmptyElement)
37 {
38 int depth = xmlReader.Depth;
39 xmlReader.Read();
40 while (xmlReader.Depth > depth && xmlReader.NodeType != XmlNodeType.EndElement)
41 {
43 if (xmlNode2 == null)
44 {
46 }
47 list.Add(xmlNode2);
48 }
49 }
50 return list.ToArray();
51 }
52
54 {
55 if (xmlReader.NamespaceURI != "http://schemas.microsoft.com/2003/10/Serialization/" && xmlReader.NamespaceURI != "http://www.w3.org/2001/XMLSchema-instance" && xmlReader.Prefix != "xmlns")
56 {
57 return xmlReader.LocalName != "xmlns";
58 }
59 return false;
60 }
61
62 public static void WriteNodes(XmlWriter xmlWriter, XmlNode?[]? nodes)
63 {
64 if (xmlWriter == null)
65 {
67 }
68 if (nodes == null)
69 {
70 return;
71 }
72 for (int i = 0; i < nodes.Length; i++)
73 {
74 if (nodes[i] != null)
75 {
76 nodes[i].WriteTo(xmlWriter);
77 }
78 }
79 }
80
82 {
83 if (schemas == null)
84 {
86 }
87 if (typeQName == null)
88 {
90 }
91 SchemaExporter.AddDefaultXmlType(schemas, typeQName.Name, typeQName.Namespace);
92 }
93}
static void AddDefaultXmlType(XmlSchemaSet schemas, string localName, string ns)
static SerializationException CreateSerializationException(string errorMessage)
static void AddDefaultSchema(XmlSchemaSet schemas, XmlQualifiedName typeQName)
static void WriteNodes(XmlWriter xmlWriter, XmlNode?[]? nodes)
static string UnexpectedEndOfFile
Definition SR.cs:292
Definition SR.cs:7
void WriteTo(XmlWriter w)