Ver Fonte

2002-03-14 Dietmar Maurer <[email protected]>

	* Delegate.cs (Equals): also compare method_ptr
	(GetHashCode): returm method_ptr as hash

	* MonoMethod.cs (Invoke): call InternalInvoke

	* MethodBase.cs (Invoke): call virtual invoke function

svn path=/trunk/mcs/; revision=3102
Dietmar Maurer há 24 anos atrás
pai
commit
d4b18d1e82

+ 5 - 0
mcs/class/corlib/System.Reflection/ChangeLog

@@ -1,3 +1,8 @@
+2002-03-14  Dietmar Maurer  <[email protected]>
+
+	* MonoMethod.cs (Invoke): call InternalInvoke
+
+	* MethodBase.cs (Invoke): call virtual invoke function 
 
 Thu Mar 7 17:14:20 CET 2002 Paolo Molaro <[email protected]>
 

+ 1 - 1
mcs/class/corlib/System.Reflection/MethodBase.cs

@@ -30,7 +30,7 @@ namespace System.Reflection {
 		public abstract ParameterInfo[] GetParameters();
 		
 		public Object Invoke(Object obj, Object[] parameters) {
-			return null;
+			return Invoke (obj, 0, null, parameters, null);
 		}
 
 		public abstract Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture);

+ 2 - 1
mcs/class/corlib/System.Reflection/MonoMethod.cs

@@ -69,7 +69,8 @@ namespace System.Reflection {
 		
 		[MonoTODO]
 		public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) {
-			throw new NotImplementedException ();
+			// fixme: consider all other parameters
+			return InternalInvoke (obj, parameters);
 		}
 
 		public override RuntimeMethodHandle MethodHandle { 

+ 5 - 0
mcs/class/corlib/System/ChangeLog

@@ -1,3 +1,8 @@
+2002-03-14  Dietmar Maurer  <[email protected]>
+
+	* Delegate.cs (Equals): also compare method_ptr 
+	(GetHashCode): returm method_ptr as hash
+
 2002-03-13  Duco Fijma  <[email protected]>
 	* TimeSpan.cs: removed the use of Custom Numeric Format Strings,
 	such as 42.ToString("0000000"), as these are (currently) not implemented

+ 4 - 3
mcs/class/corlib/System/Delegate.cs

@@ -95,7 +95,8 @@ namespace System {
 			Delegate d = (Delegate) o;
 			if ((d.target_type == target_type) &&
 			    (d.m_target == m_target) &&
-			    (d.method_name == method_name))
+			    (d.method_name == method_name) &&
+			    (d.method_ptr == method_ptr))
 				return true;
 
 			return false;
@@ -103,7 +104,7 @@ namespace System {
 
 		public override int GetHashCode ()
 		{
-			return method_name.GetHashCode ();
+			return (int)method_ptr;
 		}
 
 		// This is from ISerializable
@@ -178,7 +179,7 @@ namespace System {
 
 		public static bool operator ==( Delegate a, Delegate b )
 		{
-			if ( (object)a == null ) {
+			if ((object)a == null) {
 				if ((object)b == null)
 					return true;
 				return false;