Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ReflectionTypeLoadException.cs
Go to the documentation of this file.
3using System.Text;
4
5namespace System.Reflection;
6
8[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
10{
11 public Type?[] Types { get; }
12
13 public Exception?[] LoaderExceptions { get; }
14
15 public override string Message => CreateString(isMessage: true);
16
21
23 : base(message)
24 {
27 base.HResult = -2146232830;
28 }
29
31 : base(info, context)
32 {
34 LoaderExceptions = ((Exception[])info.GetValue("Exceptions", typeof(Exception[]))) ?? Array.Empty<Exception>();
35 }
36
38 {
39 base.GetObjectData(info, context);
40 info.AddValue("Types", null, typeof(Type[]));
41 info.AddValue("Exceptions", LoaderExceptions, typeof(Exception[]));
42 }
43
44 public override string ToString()
45 {
46 return CreateString(isMessage: false);
47 }
48
49 private string CreateString(bool isMessage)
50 {
51 string text = (isMessage ? base.Message : base.ToString());
53 if (loaderExceptions.Length == 0)
54 {
55 return text;
56 }
59 foreach (Exception ex in array)
60 {
61 if (ex != null)
62 {
63 stringBuilder.AppendLine().Append(isMessage ? ex.Message : ex.ToString());
64 }
65 }
66 return stringBuilder.ToString();
67 }
68}
override string ToString()
Definition Exception.cs:384
ReflectionTypeLoadException(Type?[]? classes, Exception?[]? exceptions)
override void GetObjectData(SerializationInfo info, StreamingContext context)
ReflectionTypeLoadException(SerializationInfo info, StreamingContext context)
ReflectionTypeLoadException(Type?[]? classes, Exception?[]? exceptions, string? message)
static readonly Type[] EmptyTypes
Definition Type.cs:19