11 [global::__DynamicallyInvokable]
16 private string[] args;
18 private int lineNumber;
20 private int linePosition;
23 private string sourceUri;
25 private string message;
29 [global::__DynamicallyInvokable]
32 [global::__DynamicallyInvokable]
41 [global::__DynamicallyInvokable]
44 [global::__DynamicallyInvokable]
57 [global::__DynamicallyInvokable]
60 [global::__DynamicallyInvokable]
71 internal string ResString => res;
79 res = (string)info.GetValue(
"res", typeof(
string));
80 args = (
string[])info.GetValue(
"args", typeof(
string[]));
81 lineNumber = (int)info.GetValue(
"lineNumber", typeof(
int));
82 linePosition = (int)info.GetValue(
"linePosition", typeof(
int));
83 sourceUri =
string.Empty;
89 string name = current.
Name;
90 if (!(name ==
"sourceUri"))
92 if (name ==
"version")
94 text = (string)current.
Value;
99 sourceUri = (string)current.
Value;
104 message = CreateMessage(res, args, lineNumber, linePosition);
118 base.GetObjectData(info, context);
119 info.AddValue(
"res", res);
120 info.AddValue(
"args", args);
121 info.AddValue(
"lineNumber", lineNumber);
122 info.AddValue(
"linePosition", linePosition);
123 info.AddValue(
"sourceUri", sourceUri);
124 info.AddValue(
"version",
"2.0");
128 [global::__DynamicallyInvokable]
136 [global::__DynamicallyInvokable]
145 [global::__DynamicallyInvokable]
147 : this(message, innerException, 0, 0)
156 [global::__DynamicallyInvokable]
158 : this(message, innerException, lineNumber, linePosition, null)
162 internal XmlException(
string message,
Exception innerException,
int lineNumber,
int linePosition,
string sourceUri)
163 : base(FormatUserMessage(message, lineNumber, linePosition), innerException)
165 base.HResult = -2146232000;
166 res = ((message ==
null) ?
"Xml_DefaultException" :
"Xml_UserException");
171 this.sourceUri = sourceUri;
172 this.lineNumber = lineNumber;
173 this.linePosition = linePosition;
177 : this(res, args, null, 0, 0, null)
181 internal XmlException(
string res,
string[] args,
string sourceUri)
182 : this(res, args, null, 0, 0, sourceUri)
187 : this(res, new string[1]
194 internal XmlException(
string res,
string arg,
string sourceUri)
195 : this(res, new string[1]
198 },
null, 0, 0, sourceUri)
202 internal XmlException(
string res,
string arg, IXmlLineInfo lineInfo)
203 : this(res, new string[1]
211 : this(res, new string[1]
214 }, innerException, lineInfo?.LineNumber ?? 0, lineInfo?.LinePosition ?? 0,
null)
218 internal XmlException(
string res,
string arg, IXmlLineInfo lineInfo,
string sourceUri)
219 : this(res, new string[1]
222 }, lineInfo, sourceUri)
226 internal XmlException(
string res,
string[] args, IXmlLineInfo lineInfo)
227 : this(res, args, lineInfo, null)
231 internal XmlException(
string res,
string[] args, IXmlLineInfo lineInfo,
string sourceUri)
236 internal XmlException(
string res,
int lineNumber,
int linePosition)
237 : this(res, null, null, lineNumber, linePosition)
241 internal XmlException(
string res,
string arg,
int lineNumber,
int linePosition)
242 : this(res, new string[1]
245 },
null, lineNumber, linePosition,
null)
249 internal XmlException(
string res,
string arg,
int lineNumber,
int linePosition,
string sourceUri)
250 : this(res, new string[1]
253 },
null, lineNumber, linePosition, sourceUri)
257 internal XmlException(
string res,
string[] args,
int lineNumber,
int linePosition)
258 : this(res, args, null, lineNumber, linePosition, null)
262 internal XmlException(
string res,
string[] args,
int lineNumber,
int linePosition,
string sourceUri)
263 : this(res, args, null, lineNumber, linePosition, sourceUri)
267 internal XmlException(
string res,
string[] args,
Exception innerException,
int lineNumber,
int linePosition)
268 : this(res, args, innerException, lineNumber, linePosition, null)
272 internal XmlException(
string res,
string[] args,
Exception innerException,
int lineNumber,
int linePosition,
string sourceUri)
273 : base(CreateMessage(res, args, lineNumber, linePosition), innerException)
275 base.HResult = -2146232000;
278 this.sourceUri = sourceUri;
279 this.lineNumber = lineNumber;
280 this.linePosition = linePosition;
283 private static string FormatUserMessage(
string message,
int lineNumber,
int linePosition)
287 return CreateMessage(
"Xml_DefaultException",
null, lineNumber, linePosition);
289 if (lineNumber == 0 && linePosition == 0)
293 return CreateMessage(
"Xml_UserException",
new string[1]
296 }, lineNumber, linePosition);
299 private static string CreateMessage(
string res,
string[] args,
int lineNumber,
int linePosition)
305 return Res.GetString(res, args);
309 string @
string = Res.GetString(res, args);
310 return Res.GetString(
"Xml_MessageWithErrorPosition", @
string, text, text2);
314 return "UNKNOWN(" + res +
")";
318 internal static string[] BuildCharExceptionArgs(
string data,
int invCharIndex)
320 return BuildCharExceptionArgs(data[invCharIndex], (invCharIndex + 1 < data.Length) ? data[invCharIndex + 1] :
'\0');
323 internal static string[] BuildCharExceptionArgs(
char[] data,
int invCharIndex)
325 return BuildCharExceptionArgs(data, data.Length, invCharIndex);
328 internal static string[] BuildCharExceptionArgs(
char[] data,
int length,
int invCharIndex)
330 return BuildCharExceptionArgs(data[invCharIndex], (invCharIndex + 1 < length) ? data[invCharIndex + 1] :
'\0');
333 internal static string[] BuildCharExceptionArgs(
char invChar,
char nextChar)
335 string[] array =
new string[2];
336 if (XmlCharType.IsHighSurrogate(invChar) && nextChar != 0)
338 int num = XmlCharType.CombineSurrogateChar(nextChar, invChar);
339 array[0] =
new string(
new char[2]
367 internal static bool IsCatchableException(
Exception e)
371 return !(e is AccessViolationException);
static CultureInfo InvariantCulture
Gets the T:System.Globalization.CultureInfo object that is culture-independent (invariant).
Describes a set of security permissions applied to code. This class cannot be inherited.
int LineNumber
Gets the line number indicating where the error occurred.
Serves as the base class for system exceptions namespace.
int LinePosition
Gets the line position indicating where the error occurred.
Describes the source and destination of a given serialized stream, and provides an additional caller-...
string SourceUri
Gets the location of the XML file.
XmlException(string message, Exception innerException, int lineNumber, int linePosition)
Initializes a new instance of the XmlException class with the specified message, inner exception,...
SecurityAction
Specifies the security actions that can be performed using declarative security.
The exception that is thrown when a T:System.Threading.Thread is interrupted while it is in a waiting...
XmlException()
Initializes a new instance of the XmlException class.
XmlException(string message)
Initializes a new instance of the XmlException class with a specified error message.
override void GetObjectData(SerializationInfo info, StreamingContext context)
Streams all the XmlException properties into the T:System.Runtime.Serialization.SerializationInfo cla...
XmlException(string message, Exception innerException)
Initializes a new instance of the XmlException class.
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
The exception that is thrown if the main assembly does not contain the resources for the neutral cult...
Returns detailed information about the last exception.
Exception()
Initializes a new instance of the T:System.Exception class.
XmlException(SerializationInfo info, StreamingContext context)
Initializes a new instance of the XmlException class using the information in the T:System....
Represents errors that occur during application execution.To browse the .NET Framework source code fo...
Specifies that the class can be serialized.
Holds the value, T:System.Type, and name of a serialized object.
Provides information about a specific culture (called a locale for unmanaged code development)....
The exception that is thrown when a call is made to the M:System.Threading.Thread....
Provides a formatter-friendly mechanism for parsing the data in T:System.Runtime.Serialization....
override string Message
Gets a message describing the current exception.
object Value
Gets the value contained in the object.
string Name
Gets the name of the object.
bool MoveNext()
Updates the enumerator to the next item.