Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@ -34,22 +34,32 @@ using System.Runtime.InteropServices;
using System.Reflection.Emit;
#endif
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace System.Reflection {
#if NET_4_0
abstract class RuntimeAssembly : Assembly
{
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
UnitySerializationHolder.GetUnitySerializationInfo (info,
UnitySerializationHolder.AssemblyUnity,
this.FullName,
this);
}
}
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_Assembly))]
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
class MonoAssembly : Assembly {
#else
public partial class Assembly {
#endif
class MonoAssembly : RuntimeAssembly
{
public
#if NET_4_0
override
#endif
Type GetType (string name, bool throwOnError, bool ignoreCase)
{
Type res;
@ -59,20 +69,11 @@ namespace System.Reflection {
throw new ArgumentException ("name", "Name cannot be empty");
res = InternalGetType (null, name, throwOnError, ignoreCase);
#if !NET_4_0 && !FULL_AOT_RUNTIME
if (res is TypeBuilder) {
if (throwOnError)
throw new TypeLoadException (string.Format ("Could not load type '{0}' from assembly '{1}'", name, this));
return null;
}
#endif
return res;
}
public
#if NET_4_0
override
#endif
Module GetModule (String name)
{
if (name == null)
@ -90,17 +91,13 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
AssemblyName[] GetReferencedAssemblies () {
return GetReferencedAssemblies (this);
}
public
#if NET_4_0
override
#endif
Module[] GetModules (bool getResourceModules) {
Module[] modules = GetModulesInternal ();
@ -117,27 +114,21 @@ namespace System.Reflection {
[MonoTODO ("Always returns the same as GetModules")]
public
#if NET_4_0
override
#endif
Module[] GetLoadedModules (bool getResourceModules)
{
return GetModules (getResourceModules);
}
public
#if NET_4_0
override
#endif
Assembly GetSatelliteAssembly (CultureInfo culture)
{
return GetSatelliteAssembly (culture, null, true);
}
public
#if NET_4_0
override
#endif
Assembly GetSatelliteAssembly (CultureInfo culture, Version version)
{
return GetSatelliteAssembly (culture, version, true);
@ -146,9 +137,7 @@ namespace System.Reflection {
//FIXME remove GetManifestModule under v4, it's a v2 artifact
[ComVisible (false)]
public
#if NET_4_0
override
#endif
Module ManifestModule {
get {
return GetManifestModule ();
@ -156,9 +145,7 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
bool GlobalAssemblyCache {
get {
return get_global_assembly_cache ();