Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlSchemaException.cs
Go to the documentation of this file.
4
5namespace System.Xml.Schema;
6
8[TypeForwardedFrom("System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
10{
11 private readonly string _res;
12
13 private readonly string[] _args;
14
15 private string _sourceUri;
16
17 private int _lineNumber;
18
19 private int _linePosition;
20
22
23 private readonly string _message;
24
25 internal string? GetRes => _res;
26
27 internal string?[]? Args => _args;
28
29 public string? SourceUri => _sourceUri;
30
31 public int LineNumber => _lineNumber;
32
34
36
37 public override string Message
38 {
39 get
40 {
41 if (_message != null)
42 {
43 return _message;
44 }
45 return base.Message;
46 }
47 }
48
50 : base(info, context)
51 {
52 _res = (string)info.GetValue("res", typeof(string));
53 _args = (string[])info.GetValue("args", typeof(string[]));
54 _sourceUri = (string)info.GetValue("sourceUri", typeof(string));
55 _lineNumber = (int)info.GetValue("lineNumber", typeof(int));
56 _linePosition = (int)info.GetValue("linePosition", typeof(int));
57 string text = null;
59 while (enumerator.MoveNext())
60 {
61 SerializationEntry current = enumerator.Current;
62 if (current.Name == "version")
63 {
64 text = (string)current.Value;
65 }
66 }
67 if (text == null)
68 {
70 }
71 else
72 {
73 _message = null;
74 }
75 }
76
78 {
79 base.GetObjectData(info, context);
80 info.AddValue("res", _res);
81 info.AddValue("args", _args);
82 info.AddValue("sourceUri", _sourceUri);
83 info.AddValue("lineNumber", _lineNumber);
84 info.AddValue("linePosition", _linePosition);
85 info.AddValue("version", "2.0");
86 }
87
89 : this(null)
90 {
91 }
92
93 public XmlSchemaException(string? message)
94 : this(message, (Exception?)null, 0, 0)
95 {
96 }
97
99 : this(message, innerException, 0, 0)
100 {
101 }
102
103 public XmlSchemaException(string? message, Exception? innerException, int lineNumber, int linePosition)
104 : this((message == null) ? System.SR.Sch_DefaultException : System.SR.Xml_UserException, new string[1] { message }, innerException, null, lineNumber, linePosition, null)
105 {
106 }
107
108 internal XmlSchemaException(string res, string[] args)
109 : this(res, args, null, null, 0, 0, null)
110 {
111 }
112
113 internal XmlSchemaException(string res, string arg)
114 : this(res, new string[1] { arg }, null, null, 0, 0, null)
115 {
116 }
117
118 internal XmlSchemaException(string res, string arg, string sourceUri, int lineNumber, int linePosition)
119 : this(res, new string[1] { arg }, null, sourceUri, lineNumber, linePosition, null)
120 {
121 }
122
123 internal XmlSchemaException(string res, string sourceUri, int lineNumber, int linePosition)
124 : this(res, null, null, sourceUri, lineNumber, linePosition, null)
125 {
126 }
127
128 internal XmlSchemaException(string res, string[] args, string sourceUri, int lineNumber, int linePosition)
129 : this(res, args, null, sourceUri, lineNumber, linePosition, null)
130 {
131 }
132
134 : this(res, (string[])null, source)
135 {
136 }
137
139 : this(res, new string[1] { arg }, source)
140 {
141 }
142
147
148 internal XmlSchemaException(string res, string[] args, Exception innerException, string sourceUri, int lineNumber, int linePosition, XmlSchemaObject source)
150 {
151 base.HResult = -2146231999;
152 _res = res;
153 _args = args;
155 _lineNumber = lineNumber;
156 _linePosition = linePosition;
158 }
159
160 internal static string CreateMessage(string res, string[] args)
161 {
162 try
163 {
164 if (args == null)
165 {
166 return res;
167 }
168 return string.Format(res ?? string.Empty, args);
169 }
171 {
172 return "UNKNOWN(" + res + ")";
173 }
174 }
175
176 internal void SetSource(string sourceUri, int lineNumber, int linePosition)
177 {
179 _lineNumber = lineNumber;
180 _linePosition = linePosition;
181 }
182
187
189 {
191 _sourceUri = source.SourceUri;
192 _lineNumber = source.LineNumber;
193 _linePosition = source.LinePosition;
194 }
195}
Definition SR.cs:7
XmlSchemaException(string res, string[] args, XmlSchemaObject source)
XmlSchemaException(string res, string[] args, Exception innerException, string sourceUri, int lineNumber, int linePosition, XmlSchemaObject source)
void SetSchemaObject(XmlSchemaObject source)
XmlSchemaException(string? message, Exception? innerException, int lineNumber, int linePosition)
XmlSchemaException(string res, string sourceUri, int lineNumber, int linePosition)
XmlSchemaException(string res, string[] args)
void SetSource(XmlSchemaObject source)
static string CreateMessage(string res, string[] args)
override void GetObjectData(SerializationInfo info, StreamingContext context)
XmlSchemaException(string res, string[] args, string sourceUri, int lineNumber, int linePosition)
XmlSchemaException(string res, string arg, string sourceUri, int lineNumber, int linePosition)
XmlSchemaException(string? message, Exception? innerException)
XmlSchemaException(SerializationInfo info, StreamingContext context)
XmlSchemaException(string res, XmlSchemaObject source)
XmlSchemaException(string res, string arg, XmlSchemaObject source)
void SetSource(string sourceUri, int lineNumber, int linePosition)