System.DefaultBinder.CompareMethodSigAndName C# (CSharp) Method

CompareMethodSigAndName() static private method

static private CompareMethodSigAndName ( MethodBase m1, MethodBase m2 ) : bool
m1 System.Reflection.MethodBase
m2 System.Reflection.MethodBase
return bool
        internal static bool CompareMethodSigAndName(MethodBase m1, MethodBase m2)
        {
            ParameterInfo[] params1 = m1.GetParametersNoCopy();
            ParameterInfo[] params2 = m2.GetParametersNoCopy();

            if (params1.Length != params2.Length)
                return false;

            int numParams = params1.Length;
            for (int i = 0; i < numParams; i++)
            {
                if (params1[i].ParameterType != params2[i].ParameterType)
                    return false;
            }

            return true;
        }

Usage Example

        // Token: 0x06000D9C RID: 3484 RVA: 0x00029C68 File Offset: 0x00027E68
        private static int FindMostSpecificMethod(MethodBase m1, int[] paramOrder1, Type paramArrayType1, MethodBase m2, int[] paramOrder2, Type paramArrayType2, Type[] types, object[] args)
        {
            int num = DefaultBinder.FindMostSpecific(m1.GetParametersNoCopy(), paramOrder1, paramArrayType1, m2.GetParametersNoCopy(), paramOrder2, paramArrayType2, types, args);

            if (num != 0)
            {
                return(num);
            }
            if (!DefaultBinder.CompareMethodSigAndName(m1, m2))
            {
                return(0);
            }
            int hierarchyDepth  = DefaultBinder.GetHierarchyDepth(m1.DeclaringType);
            int hierarchyDepth2 = DefaultBinder.GetHierarchyDepth(m2.DeclaringType);

            if (hierarchyDepth == hierarchyDepth2)
            {
                return(0);
            }
            if (hierarchyDepth < hierarchyDepth2)
            {
                return(2);
            }
            return(1);
        }