System.Reflection.RuntimeMethodInfo.Equals C# (CSharp) Method

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool
        public override bool Equals(object obj)
        {
            if (!IsGenericMethod)
                return obj == this;

            RuntimeMethodInfo mi = obj as RuntimeMethodInfo;
            
            RuntimeMethodHandle handle1 = GetMethodHandle().StripMethodInstantiation();
            RuntimeMethodHandle handle2 = mi.GetMethodHandle().StripMethodInstantiation();
            if (handle1 != handle2) 
                return false;

            if (mi == null || !mi.IsGenericMethod)
                return false;

            Type[] lhs = GetGenericArguments();
            Type[] rhs = mi.GetGenericArguments();

            if (lhs.Length != rhs.Length)
                return false;

            for (int i = 0; i < lhs.Length; i++)
            {
                if (lhs[i] != rhs[i])
                    return false;
            }

            return true;
        }
        #endregion