Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XDeclaration.cs
Go to the documentation of this file.
1using System.Text;
2
3namespace System.Xml.Linq;
4
5public class XDeclaration
6{
7 private string _version;
8
9 private string _encoding;
10
11 private string _standalone;
12
13 public string? Encoding
14 {
15 get
16 {
17 return _encoding;
18 }
19 set
20 {
22 }
23 }
24
25 public string? Standalone
26 {
27 get
28 {
29 return _standalone;
30 }
31 set
32 {
34 }
35 }
36
37 public string? Version
38 {
39 get
40 {
41 return _version;
42 }
43 set
44 {
46 }
47 }
48
49 public XDeclaration(string? version, string? encoding, string? standalone)
50 {
51 _version = version;
52 _encoding = encoding;
54 }
55
57 {
58 if (other == null)
59 {
60 throw new ArgumentNullException("other");
61 }
62 _version = other._version;
63 _encoding = other._encoding;
64 _standalone = other._standalone;
65 }
66
68 {
69 _version = r.GetAttribute("version");
70 _encoding = r.GetAttribute("encoding");
71 _standalone = r.GetAttribute("standalone");
72 r.Read();
73 }
74
75 public override string ToString()
76 {
78 stringBuilder.Append("<?xml");
79 if (_version != null)
80 {
81 stringBuilder.Append(" version=\"");
82 stringBuilder.Append(_version);
83 stringBuilder.Append('"');
84 }
85 if (_encoding != null)
86 {
87 stringBuilder.Append(" encoding=\"");
89 stringBuilder.Append('"');
90 }
91 if (_standalone != null)
92 {
93 stringBuilder.Append(" standalone=\"");
95 stringBuilder.Append('"');
96 }
97 stringBuilder.Append("?>");
99 }
100}
static string GetStringAndRelease(StringBuilder sb)
static StringBuilder Acquire(int capacity=16)
override string ToString()
XDeclaration(string? version, string? encoding, string? standalone)
XDeclaration(XDeclaration other)