Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XPathException.cs
Go to the documentation of this file.
4
5namespace System.Xml.XPath;
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 readonly string _message;
16
17 public override string Message
18 {
19 get
20 {
21 if (_message != null)
22 {
23 return _message;
24 }
25 return base.Message;
26 }
27 }
28
30 : base(info, context)
31 {
32 _res = (string)info.GetValue("res", typeof(string));
33 _args = (string[])info.GetValue("args", typeof(string[]));
34 string text = null;
36 while (enumerator.MoveNext())
37 {
38 SerializationEntry current = enumerator.Current;
39 if (current.Name == "version")
40 {
41 text = (string)current.Value;
42 }
43 }
44 if (text == null)
45 {
47 }
48 else
49 {
50 _message = null;
51 }
52 }
53
55 {
56 base.GetObjectData(info, context);
57 info.AddValue("res", _res);
58 info.AddValue("args", _args);
59 info.AddValue("version", "2.0");
60 }
61
64 {
65 }
66
67 public XPathException(string? message)
68 : this(message, (Exception?)null)
69 {
70 }
71
72 public XPathException(string? message, Exception? innerException)
73 : this(System.SR.Xml_UserException, new string[1] { message }, innerException)
74 {
75 }
76
77 internal static XPathException Create(string res)
78 {
79 return new XPathException(res, (string[])null);
80 }
81
82 internal static XPathException Create(string res, string arg)
83 {
84 return new XPathException(res, new string[1] { arg });
85 }
86
87 internal static XPathException Create(string res, string arg, string arg2)
88 {
89 return new XPathException(res, new string[2] { arg, arg2 });
90 }
91
92 internal static XPathException Create(string res, string arg, Exception innerException)
93 {
94 return new XPathException(res, new string[1] { arg }, innerException);
95 }
96
97 private XPathException(string res, string[] args)
98 : this(res, args, null)
99 {
100 }
101
102 private XPathException(string res, string[] args, Exception inner)
103 : base(CreateMessage(res, args), inner)
104 {
105 base.HResult = -2146231997;
106 _res = res;
107 _args = args;
108 }
109
110 private static string CreateMessage(string res, string[] args)
111 {
112 try
113 {
114 string text;
115 if (args != null)
116 {
117 text = string.Format(res, args);
118 }
119 else
120 {
121 text = res;
122 }
123 string text2 = text;
124 if (text2 == null)
125 {
126 text2 = "UNKNOWN(" + res + ")";
127 }
128 return text2;
129 }
131 {
132 return "UNKNOWN(" + res + ")";
133 }
134 }
135}
Definition SR.cs:7
static XPathException Create(string res, string arg)
XPathException(SerializationInfo info, StreamingContext context)
static XPathException Create(string res)
static string CreateMessage(string res, string[] args)
override void GetObjectData(SerializationInfo info, StreamingContext context)
XPathException(string res, string[] args)
static XPathException Create(string res, string arg, string arg2)
XPathException(string? message, Exception? innerException)
static XPathException Create(string res, string arg, Exception innerException)
XPathException(string res, string[] args, Exception inner)