NS2.0 Inject more missing types into CoreRT by sharing them. (#10613)
authorAtsushi Kanamori <AtsushiKan@users.noreply.github.com>
Fri, 31 Mar 2017 18:41:39 +0000 (11:41 -0700)
committerGitHub <noreply@github.com>
Fri, 31 Mar 2017 18:41:39 +0000 (11:41 -0700)
* NS2.0 Inject more missing types into CoreRT by sharing them.

- ArgIterator was cleaned up for sharing but actually
  sharing it today is too messy with TypedReference
  being in the wrong namespace on half of CoreRT.

  Some preparatory fixes discovered during the
  attempt will be going in on CoreRT...

* Leave RuntimeArgumentHandle and ArgIterator unshared.

src/mscorlib/System.Private.CoreLib.csproj
src/mscorlib/shared/System.Private.CoreLib.Shared.projitems
src/mscorlib/shared/System/AssemblyLoadEventArgs.cs [new file with mode: 0644]
src/mscorlib/shared/System/AssemblyLoadEventHandler.cs [new file with mode: 0644]
src/mscorlib/shared/System/ResolveEventArgs.cs [new file with mode: 0644]
src/mscorlib/shared/System/ResolveEventHandler.cs [new file with mode: 0644]
src/mscorlib/shared/System/TypeUnloadedException.cs [moved from src/mscorlib/src/System/TypeUnloadedException.cs with 69% similarity]
src/mscorlib/src/System/AppDomain.cs

index 489bda3..e36113e 100644 (file)
     <Compile Include="$(BclSourcesRoot)\System\Boolean.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Buffer.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Byte.cs" />
-    <Compile Include="$(BclSourcesRoot)\System\TypeUnloadedException.cs" />
     <Compile Include="$(BclSourcesRoot)\System\CompatibilitySwitches.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Currency.cs" />
     <Compile Include="$(BclSourcesRoot)\System\Decimal.cs" />
index ed578b3..b4d6bf3 100644 (file)
@@ -73,6 +73,8 @@
     <Compile Include="$(MSBuildThisFileDirectory)System\ArgumentNullException.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\ArithmeticException.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\ArrayTypeMismatchException.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\AssemblyLoadEventArgs.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\AssemblyLoadEventHandler.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\AsyncCallback.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\AttributeTargets.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\AttributeUsageAttribute.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Reflection\TypeDelegator.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Reflection\TypeFilter.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Reflection\TypeInfo.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\ResolveEventArgs.cs" />
+    <Compile Include="$(MSBuildThisFileDirectory)System\ResolveEventHandler.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CompilationRelaxations.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\CompilerGlobalScopeAttribute.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\CompilerServices\DefaultDependencyAttribute.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\TypeAccessException.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\TypeCode.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\TypeInitializationException.cs"/>
+    <Compile Include="$(MSBuildThisFileDirectory)System\TypeUnloadedException.cs" />
     <Compile Include="$(MSBuildThisFileDirectory)System\UnauthorizedAccessException.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\UnhandledExceptionEventArgs.cs"/>
     <Compile Include="$(MSBuildThisFileDirectory)System\UnhandledExceptionEventHandler.cs"/>
diff --git a/src/mscorlib/shared/System/AssemblyLoadEventArgs.cs b/src/mscorlib/shared/System/AssemblyLoadEventArgs.cs
new file mode 100644 (file)
index 0000000..d7e5249
--- /dev/null
@@ -0,0 +1,18 @@
+// 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.Reflection;
+
+namespace System
+{
+    public class AssemblyLoadEventArgs : EventArgs
+    {
+        public AssemblyLoadEventArgs(Assembly loadedAssembly)
+        {
+            LoadedAssembly = loadedAssembly;
+        }
+
+        public Assembly LoadedAssembly { get; }
+    }
+}
diff --git a/src/mscorlib/shared/System/AssemblyLoadEventHandler.cs b/src/mscorlib/shared/System/AssemblyLoadEventHandler.cs
new file mode 100644 (file)
index 0000000..752379f
--- /dev/null
@@ -0,0 +1,8 @@
+// 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.
+
+namespace System
+{
+    public delegate void AssemblyLoadEventHandler(object sender, AssemblyLoadEventArgs args);
+}
diff --git a/src/mscorlib/shared/System/ResolveEventArgs.cs b/src/mscorlib/shared/System/ResolveEventArgs.cs
new file mode 100644 (file)
index 0000000..6196947
--- /dev/null
@@ -0,0 +1,25 @@
+// 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.Reflection;
+
+namespace System
+{
+    public class ResolveEventArgs : EventArgs
+    {
+        public ResolveEventArgs(string name)
+        {
+            Name = name;
+        }
+
+        public ResolveEventArgs(string name, Assembly requestingAssembly)
+        {
+            Name = name;
+            RequestingAssembly = requestingAssembly;
+        }
+
+        public string Name { get; }
+        public Assembly RequestingAssembly { get; }
+    }
+}
diff --git a/src/mscorlib/shared/System/ResolveEventHandler.cs b/src/mscorlib/shared/System/ResolveEventHandler.cs
new file mode 100644 (file)
index 0000000..cb9af5d
--- /dev/null
@@ -0,0 +1,10 @@
+// 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.Reflection;
+
+namespace System
+{
+    public delegate Assembly ResolveEventHandler(object sender, ResolveEventArgs args);
+}
@@ -2,16 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT license.
 // See the LICENSE file in the project root for more information.
 
-/*=============================================================================
-**
-**
-**
-** Purpose: Exception class for attempt to access an unloaded class
-**
-**
-=============================================================================*/
-
-
 using System.Runtime.Serialization;
 
 namespace System
@@ -25,13 +15,13 @@ namespace System
             SetErrorCode(__HResults.COR_E_TYPEUNLOADED);
         }
 
-        public TypeUnloadedException(String message)
+        public TypeUnloadedException(string message)
             : base(message)
         {
             SetErrorCode(__HResults.COR_E_TYPEUNLOADED);
         }
 
-        public TypeUnloadedException(String message, Exception innerException)
+        public TypeUnloadedException(string message, Exception innerException)
             : base(message, innerException)
         {
             SetErrorCode(__HResults.COR_E_TYPEUNLOADED);
@@ -40,7 +30,8 @@ namespace System
         //
         // This constructor is required for serialization;
         //
-        protected TypeUnloadedException(SerializationInfo info, StreamingContext context) : base(info, context)
+        protected TypeUnloadedException(SerializationInfo info, StreamingContext context)
+            : base(info, context)
         {
         }
     }
index 8933896..7d2f2ce 100644 (file)
@@ -37,63 +37,6 @@ namespace System
     using System.Diagnostics.Contracts;
     using System.Runtime.ExceptionServices;
 
-    public class ResolveEventArgs : EventArgs
-    {
-        private String _Name;
-        private Assembly _RequestingAssembly;
-
-        public String Name
-        {
-            get
-            {
-                return _Name;
-            }
-        }
-
-        public Assembly RequestingAssembly
-        {
-            get
-            {
-                return _RequestingAssembly;
-            }
-        }
-
-        public ResolveEventArgs(String name)
-        {
-            _Name = name;
-        }
-
-        public ResolveEventArgs(String name, Assembly requestingAssembly)
-        {
-            _Name = name;
-            _RequestingAssembly = requestingAssembly;
-        }
-    }
-
-    public class AssemblyLoadEventArgs : EventArgs
-    {
-        private Assembly _LoadedAssembly;
-
-        public Assembly LoadedAssembly
-        {
-            get
-            {
-                return _LoadedAssembly;
-            }
-        }
-
-        public AssemblyLoadEventArgs(Assembly loadedAssembly)
-        {
-            _LoadedAssembly = loadedAssembly;
-        }
-    }
-
-    [Serializable]
-    public delegate Assembly ResolveEventHandler(Object sender, ResolveEventArgs args);
-
-    [Serializable]
-    public delegate void AssemblyLoadEventHandler(Object sender, AssemblyLoadEventArgs args);
-
     [Serializable]
     internal delegate void AppDomainInitializer(string[] args);