Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
FileLoadException.cs
Go to the documentation of this file.
4
5namespace System.IO;
6
8[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
10{
11 public override string Message => _message ?? (_message = FormatFileLoadExceptionMessage(FileName, base.HResult));
12
13 public string? FileName { get; }
14
15 public string? FusionLog { get; }
16
24
25 internal static string FormatFileLoadExceptionMessage(string fileName, int hResult)
26 {
27 string s = null;
29 string s2 = null;
30 if (hResult == -2147024703)
31 {
33 }
34 else
35 {
37 }
38 return string.Format(s, fileName, s2);
39 }
40
41 [DllImport("QCall", CharSet = CharSet.Unicode)]
43
44 [DllImport("QCall", CharSet = CharSet.Unicode)]
45 private static extern void GetMessageForHR(int hresult, StringHandleOnStack retString);
46
48 : base(SR.IO_FileLoad)
49 {
50 base.HResult = -2146232799;
51 }
52
53 public FileLoadException(string? message)
54 : base(message)
55 {
56 base.HResult = -2146232799;
57 }
58
59 public FileLoadException(string? message, Exception? inner)
60 : base(message, inner)
61 {
62 base.HResult = -2146232799;
63 }
64
65 public FileLoadException(string? message, string? fileName)
66 : base(message)
67 {
68 base.HResult = -2146232799;
70 }
71
72 public FileLoadException(string? message, string? fileName, Exception? inner)
73 : base(message, inner)
74 {
75 base.HResult = -2146232799;
77 }
78
79 public override string ToString()
80 {
81 string text = GetType().ToString() + ": " + Message;
82 if (!string.IsNullOrEmpty(FileName))
83 {
85 }
86 if (base.InnerException != null)
87 {
88 text = text + "\r\n ---> " + base.InnerException.ToString();
89 }
90 if (StackTrace != null)
91 {
92 text = text + "\r\n" + StackTrace;
93 }
94 if (FusionLog != null)
95 {
96 if (text == null)
97 {
98 text = " ";
99 }
100 text = text + "\r\n\r\n" + FusionLog;
101 }
102 return text;
103 }
104
106 : base(info, context)
107 {
108 FileName = info.GetString("FileLoad_FileName");
109 FusionLog = info.GetString("FileLoad_FusionLog");
110 }
111
113 {
114 base.GetObjectData(info, context);
115 info.AddValue("FileLoad_FileName", FileName, typeof(string));
116 info.AddValue("FileLoad_FusionLog", FusionLog, typeof(string));
117 }
118}
virtual ? string StackTrace
Definition Exception.cs:143
new Type GetType()
Definition Exception.cs:437
FileLoadException(string? message, Exception? inner)
FileLoadException(string fileName, int hResult)
FileLoadException(string? message, string? fileName, Exception? inner)
FileLoadException(SerializationInfo info, StreamingContext context)
static string FormatFileLoadExceptionMessage(string fileName, int hResult)
FileLoadException(string? message, string? fileName)
static void GetMessageForHR(int hresult, StringHandleOnStack retString)
static void GetFileLoadExceptionMessage(int hResult, StringHandleOnStack retString)
override void GetObjectData(SerializationInfo info, StreamingContext context)
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string IO_FileName_Name
Definition SR.cs:1548
static string Arg_BadImageFormatException
Definition SR.cs:82
Definition SR.cs:7
override string ToString()
Definition Type.cs:1108