Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TypeLoadException.cs
Go to the documentation of this file.
4
5namespace System;
6
8[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
10{
11 private string _className;
12
13 private string _assemblyName;
14
15 private readonly string _messageArg;
16
17 private readonly int _resourceId;
18
19 public override string Message
20 {
21 get
22 {
24 return _message;
25 }
26 }
27
28 public string TypeName => _className ?? string.Empty;
29
40
41 private void SetMessageField()
42 {
43 if (_message != null)
44 {
45 return;
46 }
47 if (_className == null && _resourceId == 0)
48 {
50 return;
51 }
52 if (_assemblyName == null)
53 {
55 }
56 if (_className == null)
57 {
59 }
60 string s = null;
62 _message = string.Format(s, _className, _assemblyName, _messageArg);
63 }
64
65 [DllImport("QCall", CharSet = CharSet.Unicode)]
67
69 : base(SR.Arg_TypeLoadException)
70 {
71 base.HResult = -2146233054;
72 }
73
74 public TypeLoadException(string? message)
75 : base(message)
76 {
77 base.HResult = -2146233054;
78 }
79
80 public TypeLoadException(string? message, Exception? inner)
81 : base(message, inner)
82 {
83 base.HResult = -2146233054;
84 }
85
87 : base(info, context)
88 {
89 _className = info.GetString("TypeLoadClassName");
90 _assemblyName = info.GetString("TypeLoadAssemblyName");
91 _messageArg = info.GetString("TypeLoadMessageArg");
92 _resourceId = info.GetInt32("TypeLoadResourceID");
93 }
94
96 {
97 base.GetObjectData(info, context);
98 info.AddValue("TypeLoadClassName", _className, typeof(string));
99 info.AddValue("TypeLoadAssemblyName", _assemblyName, typeof(string));
100 info.AddValue("TypeLoadMessageArg", _messageArg, typeof(string));
101 info.AddValue("TypeLoadResourceID", _resourceId);
102 }
103}
static string IO_UnknownFileName
Definition SR.cs:1596
static string Arg_TypeLoadException
Definition SR.cs:432
Definition SR.cs:7
TypeLoadException(string? message)
TypeLoadException(SerializationInfo info, StreamingContext context)
static void GetTypeLoadExceptionMessage(int resourceId, StringHandleOnStack retString)
TypeLoadException(string? message, Exception? inner)
TypeLoadException(string className, string assemblyName, string messageArg, int resourceId)
override void GetObjectData(SerializationInfo info, StreamingContext context)