Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
BadImageFormatException.cs
Go to the documentation of this file.
1using System.IO;
4
5namespace System;
6
8[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
10{
11 private readonly string _fileName;
12
13 private readonly string _fusionLog;
14
15 public override string Message
16 {
17 get
18 {
20 return _message;
21 }
22 }
23
24 public string? FileName => _fileName;
25
26 public string? FusionLog => _fusionLog;
27
35
37 : base(SR.Arg_BadImageFormatException)
38 {
39 base.HResult = -2147024885;
40 }
41
42 public BadImageFormatException(string? message)
43 : base(message)
44 {
45 base.HResult = -2147024885;
46 }
47
48 public BadImageFormatException(string? message, Exception? inner)
49 : base(message, inner)
50 {
51 base.HResult = -2147024885;
52 }
53
54 public BadImageFormatException(string? message, string? fileName)
55 : base(message)
56 {
57 base.HResult = -2147024885;
59 }
60
61 public BadImageFormatException(string? message, string? fileName, Exception? inner)
62 : base(message, inner)
63 {
64 base.HResult = -2147024885;
66 }
67
69 : base(info, context)
70 {
71 _fileName = info.GetString("BadImageFormat_FileName");
72 _fusionLog = info.GetString("BadImageFormat_FusionLog");
73 }
74
76 {
77 base.GetObjectData(info, context);
78 info.AddValue("BadImageFormat_FileName", _fileName, typeof(string));
79 info.AddValue("BadImageFormat_FusionLog", _fusionLog, typeof(string));
80 }
81
82 private void SetMessageField()
83 {
84 if (_message == null)
85 {
86 if (_fileName == null && base.HResult == -2146233088)
87 {
89 }
90 else
91 {
93 }
94 }
95 }
96
97 public override string ToString()
98 {
99 string text = GetType().ToString() + ": " + Message;
100 if (!string.IsNullOrEmpty(_fileName))
101 {
103 }
104 if (base.InnerException != null)
105 {
106 text = text + " ---> " + base.InnerException.ToString();
107 }
108 if (StackTrace != null)
109 {
110 text = text + "\r\n" + StackTrace;
111 }
112 if (_fusionLog != null)
113 {
114 if (text == null)
115 {
116 text = " ";
117 }
118 text = text + "\r\n\r\n" + _fusionLog;
119 }
120 return text;
121 }
122}
BadImageFormatException(string? message, Exception? inner)
BadImageFormatException(string fileName, int hResult)
BadImageFormatException(string? message, string? fileName)
BadImageFormatException(string? message, string? fileName, Exception? inner)
BadImageFormatException(SerializationInfo info, StreamingContext context)
override void GetObjectData(SerializationInfo info, StreamingContext context)
virtual ? string StackTrace
Definition Exception.cs:143
new Type GetType()
Definition Exception.cs:437
static string FormatFileLoadExceptionMessage(string fileName, int hResult)
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