summaryrefslogtreecommitdiff
path: root/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs')
-rw-r--r--src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs b/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs
new file mode 100644
index 0000000000..772620cf84
--- /dev/null
+++ b/src/mscorlib/shared/System/Reflection/ReflectionTypeLoadException.cs
@@ -0,0 +1,46 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Runtime.Serialization;
+
+namespace System.Reflection
+{
+ [Serializable]
+ public sealed class ReflectionTypeLoadException : SystemException, ISerializable
+ {
+ public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions)
+ : base(null)
+ {
+ Types = classes;
+ LoaderExceptions = exceptions;
+ HResult = __HResults.COR_E_REFLECTIONTYPELOAD;
+ }
+
+ public ReflectionTypeLoadException(Type[] classes, Exception[] exceptions, string message)
+ : base(message)
+ {
+ Types = classes;
+ LoaderExceptions = exceptions;
+ HResult = __HResults.COR_E_REFLECTIONTYPELOAD;
+ }
+
+ internal ReflectionTypeLoadException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ Types = (Type[])(info.GetValue("Types", typeof(Type[])));
+ LoaderExceptions = (Exception[])(info.GetValue("Exceptions", typeof(Exception[])));
+ }
+
+ public override void GetObjectData(SerializationInfo info, StreamingContext context)
+ {
+ base.GetObjectData(info, context);
+ info.AddValue("Types", Types, typeof(Type[]));
+ info.AddValue("Exceptions", LoaderExceptions, typeof(Exception[]));
+ }
+
+ public Type[] Types { get; }
+
+ public Exception[] LoaderExceptions { get; }
+ }
+}