private static bool TypesEqual(Type[] tx, Type[] ty)
 {
     for (int index = 0; index < tx.Length; ++index)
     {
         if (!MemberEqualityComparer.Equals((MemberInfo)tx[index], (MemberInfo)ty[index]))
         {
             return(false);
         }
     }
     return(true);
 }
        internal static bool Equals(MemberInfo mx, MemberInfo my)
        {
            if (object.ReferenceEquals((object)mx, (object)my))
            {
                return(true);
            }
            if (mx == null || my == null || (mx.MetadataToken != my.MetadataToken || !object.Equals((object)mx.Module, (object)my.Module)))
            {
                return(false);
            }
            Type type1;
            Type type2;

            if ((type1 = mx as Type) != null && (type2 = my as Type) != null)
            {
                if (type1.IsGenericType)
                {
                    if (type1.IsGenericTypeDefinition != type2.IsGenericTypeDefinition)
                    {
                        return(false);
                    }
                    if (!type1.IsGenericTypeDefinition)
                    {
                        return(MemberEqualityComparer.TypesEqual(type1.GetGenericArguments(), type2.GetGenericArguments()));
                    }
                }
            }
            else
            {
                MethodInfo methodInfo1;
                MethodInfo methodInfo2;
                if ((methodInfo1 = mx as MethodInfo) != null && (methodInfo2 = my as MethodInfo) != null && methodInfo1.IsGenericMethod)
                {
                    if (methodInfo1.IsGenericMethodDefinition != methodInfo2.IsGenericMethodDefinition)
                    {
                        return(false);
                    }
                    if (!methodInfo1.IsGenericMethodDefinition)
                    {
                        return(MemberEqualityComparer.TypesEqual(methodInfo1.GetGenericArguments(), methodInfo2.GetGenericArguments()));
                    }
                }
            }
            return(true);
        }
 bool IEqualityComparer <MemberInfo> .Equals(MemberInfo x, MemberInfo y)
 {
     return(MemberEqualityComparer.Equals(x, y));
 }
 bool IEqualityComparer.Equals(object x, object y)
 {
     return(MemberEqualityComparer.Equals(x as MemberInfo, y as MemberInfo));
 }