public override bool Equals(object obj) { if (!this.IsGenericMethod) { return(obj == this); } RuntimeMethodInfo info = obj as RuntimeMethodInfo; RuntimeMethodHandle handle = this.GetMethodHandle().StripMethodInstantiation(); RuntimeMethodHandle handle2 = info.GetMethodHandle().StripMethodInstantiation(); if (handle != handle2) { return(false); } if ((info == null) || !info.IsGenericMethod) { return(false); } Type[] genericArguments = this.GetGenericArguments(); Type[] typeArray2 = info.GetGenericArguments(); if (genericArguments.Length != typeArray2.Length) { return(false); } for (int i = 0; i < genericArguments.Length; i++) { if (genericArguments[i] != typeArray2[i]) { return(false); } } if (info.IsGenericMethod) { if (this.DeclaringType != info.DeclaringType) { return(false); } if (this.ReflectedType != info.ReflectedType) { return(false); } } return(true); }