<Compile Include="$(BclSourcesRoot)\System\Reflection\MethodImplAttributes.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Missing.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\Module.cs" />
- <Compile Include="$(BclSourcesRoot)\System\Reflection\Module.CoreCLR.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\ModuleResolveEventHandler.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\MethodBody.cs" />
<Compile Include="$(BclSourcesRoot)\System\Reflection\ParameterAttributes.cs" />
}
}
- internal override ModuleHandle GetModuleHandle()
+ protected override ModuleHandle GetModuleHandleImpl()
{
return new ModuleHandle(GetNativeHandle());
}
+++ /dev/null
-// 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
-{
- public abstract partial class Module : ISerializable, ICustomAttributeProvider
- {
- // Used to provide implementation and overriding point for ModuleHandle.
- // To get a module handle inside mscorlib, use GetNativeHandle instead.
- internal virtual ModuleHandle GetModuleHandle()
- {
- return ModuleHandle.EmptyHandle;
- }
- }
-}
namespace System.Reflection
{
- public abstract partial class Module : ICustomAttributeProvider, ISerializable
+ public abstract class Module : ICustomAttributeProvider, ISerializable
{
protected Module() { }
public virtual int MDStreamVersion { get { throw NotImplemented.ByDesign; } }
public virtual Guid ModuleVersionId { get { throw NotImplemented.ByDesign; } }
public virtual string ScopeName { get { throw NotImplemented.ByDesign; } }
- public ModuleHandle ModuleHandle => GetModuleHandle();
+ public ModuleHandle ModuleHandle => GetModuleHandleImpl();
+ protected virtual ModuleHandle GetModuleHandleImpl() => ModuleHandle.EmptyHandle; // Not an api but declared protected because of Reflection.Core/Corelib divide (when built by CoreRt)
public virtual void GetPEKind(out PortableExecutableKinds peKind, out ImageFileMachine machine) { throw NotImplemented.ByDesign; }
public virtual bool IsResource() { throw NotImplemented.ByDesign; }
try
{
- Type t = GetModuleHandle().ResolveTypeHandle(metadataToken, typeArgs, methodArgs).GetRuntimeType();
+ Type t = GetModuleHandleImpl().ResolveTypeHandle(metadataToken, typeArgs, methodArgs).GetRuntimeType();
if (t == null)
throw new ArgumentException(Environment.GetResourceString("Argument_ResolveType", tk, this), nameof(metadataToken));
return m_runtimeAssembly;
}
-
- internal override ModuleHandle GetModuleHandle()
+ protected override ModuleHandle GetModuleHandleImpl()
{
return new ModuleHandle(this);
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-//
-//
-//
-// Implements System.Type
-//
-// ======================================================================================
-
using System.Reflection;
using System.Threading;
using System.Runtime.CompilerServices;