Resolving a member name at runtime
===

Given a *type*, a *name* and a *signature*, how can I do a member lookup of the member with name *name* and signature *signature* using the C# rules of 7.4 (the 7.4 is the chapter number from the C# Language Specification) (or at least part of them... Let's say I can live with an exact match, without conversions/casts) **at runtime**? I need to get a `MethodInfo`/`PropertyInfo`/... because then I have to use it with reflection (to be more exact I'm trying to build an `Expression.ForEach` builder (a factory able to create an Expression Tree that represent a `foreach` statement), and to be pixel-perfect with the C# `foreach` I have to be able to do duck-typing and search for a `GetEnumerator` method (in the collection), a `Current` property and a `MoveNext` method (in the enumerator), as written in 8.8.4)

The problem (an example of the problem)


    class C1
    {
        public int Current { get; set; }

        public object MoveNext()
        {
            return null;
        }
    }

    class C2 : C1
    {
        public new long Current { get; set; }

        public new bool MoveNext()
        {
            return true;
        }
    }

    class C3 : C2
    {
    }

    var m = typeof(C3).GetMethods(); // I get both versions of MoveNext()
    var p = typeof(C3).GetProperties(); // I get both versions of Current

Clearly if I try `typeof(C3).GetProperty("Current")` I get an exception.

A similar but different problem is present with interfaces:

    interface I0
    {
        int Current { get; set; }
    }

    interface I1 : I0
    {
        new long Current { get; set; }
    }

    interface I2 : I1, I0
    {
        new object Current { get; set; }
    }

    interface I3 : I2
    {
    }

Here if I try to do a `typeof(I3).GetProperties()` I don't get the `Current` property (and this is something known, see for example http://stackoverflow.com/questions/358835/getproperties-to-return-all-properties-for-an-interface-inheritance-hierarchy), but I can't simply flatten the interfaces, because then I wouldn't know who is hiding who.

I know that probably this problem is solved somewhere in the `Microsoft.CSharp.RuntimeBinder` namespace (declared in the `Microsoft.CSharp` assembly). This because I'm trying to use C# rules and member lookup is necessary when you have dynamic method invocation, but I haven't been able to find anything (and then what I would get would be an `Expression` or perhaps a direct invocation).