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,32 +34,24 @@ using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
using System.Security;
using System.Security.Permissions;
using System.Runtime.Serialization;
namespace System.Reflection {
#if NET_4_0
[ComVisible (true)]
[ComDefaultInterfaceAttribute (typeof (_Module))]
[Serializable]
[ClassInterface(ClassInterfaceType.None)]
class MonoModule : Module {
#else
public partial class Module {
#endif
public
#if NET_4_0
override
#endif
Assembly Assembly {
get { return assembly; }
}
public
#if NET_4_0
override
#endif
// Note: we do not ask for PathDiscovery because no path is returned here.
// However MS Fx requires it (see FDBK23572 for details).
string Name {
@ -67,17 +59,13 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
string ScopeName {
get { return scopename; }
}
public
#if NET_4_0
override
#endif
int MDStreamVersion {
get {
if (_impl == IntPtr.Zero)
@ -87,20 +75,14 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
Guid ModuleVersionId {
get {
return GetModuleVersionId ();
}
}
#if NET_4_0
public override
#else
public virtual
#endif
string FullyQualifiedName {
get {
#if !NET_2_1
@ -113,19 +95,13 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
bool IsResource()
{
return is_resource;
}
#if NET_4_0
public override
#else
public virtual
#endif
Type[] FindTypes(TypeFilter filter, object filterCriteria)
{
var filtered = new List<Type> ();
@ -136,31 +112,19 @@ namespace System.Reflection {
return filtered.ToArray ();
}
#if NET_4_0
public override
#else
public virtual
#endif
object[] GetCustomAttributes(bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes (this, inherit);
}
#if NET_4_0
public override
#else
public virtual
#endif
object[] GetCustomAttributes(Type attributeType, bool inherit)
{
return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
}
#if NET_4_0
public override
#else
public virtual
#endif
FieldInfo GetField (string name, BindingFlags bindingAttr)
{
if (IsResource ())
@ -170,11 +134,7 @@ namespace System.Reflection {
return (globalType != null) ? globalType.GetField (name, bindingAttr) : null;
}
#if NET_4_0
public override
#else
public virtual
#endif
FieldInfo[] GetFields (BindingFlags bindingFlags)
{
if (IsResource ())
@ -184,20 +144,12 @@ namespace System.Reflection {
return (globalType != null) ? globalType.GetFields (bindingFlags) : new FieldInfo [0];
}
#if NET_4_0
public override
#else
public virtual
#endif
int MetadataToken {
get { return get_MetadataToken (this); }
}
protected
#if NET_4_0
override
#else
virtual
#endif
MethodInfo GetMethodImpl (string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers)
{
if (IsResource ())
@ -212,9 +164,7 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
MethodInfo[] GetMethods (BindingFlags bindingFlags) {
if (IsResource ())
return new MethodInfo [0];
@ -223,20 +173,12 @@ namespace System.Reflection {
return (globalType != null) ? globalType.GetMethods (bindingFlags) : new MethodInfo [0];
}
#if NET_4_0
public override
#else
public virtual
#endif
void GetPEKind (out PortableExecutableKinds peKind, out ImageFileMachine machine) {
ModuleHandle.GetPEKind (out peKind, out machine);
}
#if NET_4_0
public override
#else
public virtual
#endif
Type GetType(string className, bool throwOnError, bool ignoreCase)
{
if (className == null)
@ -246,20 +188,14 @@ namespace System.Reflection {
return assembly.InternalGetType (this, className, throwOnError, ignoreCase);
}
#if NET_4_0
public override
#else
public virtual
#endif
bool IsDefined (Type attributeType, bool inherit)
{
return MonoCustomAttrs.IsDefined (this, attributeType, inherit);
}
public
#if NET_4_0
override
#endif
FieldInfo ResolveField (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
ResolveTokenError error;
@ -271,9 +207,7 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
MemberInfo ResolveMember (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
ResolveTokenError error;
@ -286,9 +220,7 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
MethodBase ResolveMethod (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
ResolveTokenError error;
@ -300,9 +232,7 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
string ResolveString (int metadataToken) {
ResolveTokenError error;
@ -314,9 +244,7 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
Type ResolveType (int metadataToken, Type [] genericTypeArguments, Type [] genericMethodArguments) {
ResolveTokenError error;
@ -328,9 +256,7 @@ namespace System.Reflection {
}
public
#if NET_4_0
override
#endif
byte[] ResolveSignature (int metadataToken) {
ResolveTokenError error;
@ -341,12 +267,18 @@ namespace System.Reflection {
return res;
}
public override void GetObjectData (SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException ("info");
UnitySerializationHolder.GetUnitySerializationInfo (info, UnitySerializationHolder.ModuleUnity, this.ScopeName, this.GetRuntimeAssembly ());
}
#if !NET_2_1
public
#if NET_4_0
override
#endif
X509Certificate GetSignerCertificate ()
{
try {
@ -358,20 +290,19 @@ namespace System.Reflection {
}
#endif
#if NET_4_0
public override
#else
public virtual
#endif
Type[] GetTypes()
{
return InternalGetTypes ();
}
#if NET_4_0
public override IList<CustomAttributeData> GetCustomAttributesData () {
return CustomAttributeData.GetCustomAttributes (this);
}
#endif
internal RuntimeAssembly GetRuntimeAssembly ()
{
return (RuntimeAssembly)assembly;
}
}
}