private object m_target;
private IntPtr method;
private IntPtr delegate_trampoline;
- private IntPtr rgctx;
+ private IntPtr extra_arg;
private IntPtr method_code;
private MethodInfo method_info;
public MethodInfo Method {
get {
- if (method_info != null) {
- return method_info;
- } else {
- if (method != IntPtr.Zero) {
- if (!method_is_virtual)
- method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method));
- else
- method_info = GetVirtualMethod_internal ();
- }
- return method_info;
- }
+ return GetMethodImpl ();
}
}
public override int GetHashCode ()
{
- /* same implementation as CoreCLR */
- return GetType ().GetHashCode ();
+ MethodInfo m;
+
+ m = Method;
+
+ return (m != null ? m.GetHashCode () : GetType ().GetHashCode ()) ^ (m_target != null ? m_target.GetHashCode () : 0);
}
protected virtual MethodInfo GetMethodImpl ()
{
- return Method;
+ if (method_info != null) {
+ return method_info;
+ } else {
+ if (method != IntPtr.Zero) {
+ if (!method_is_virtual)
+ method_info = (MethodInfo)MethodBase.GetMethodFromHandleNoGenericCheck (new RuntimeMethodHandle (method));
+ else
+ method_info = GetVirtualMethod_internal ();
+ }
+ return method_info;
+ }
}
// This is from ISerializable
if (a == null)
return b;
+ if (b == null)
+ return a;
+
+ if (a.GetType () != b.GetType ())
+ throw new ArgumentException (Locale.GetText ("Incompatible Delegate Types. First is {0} second is {1}.", a.GetType ().FullName, b.GetType ().FullName));
+
return a.CombineImpl (b);
}