OK, I found a way, using GetInterfaceMap.
var map = targetType.GetInterfaceMap(interfaceMethod.DeclaringType);
var index = Array.IndexOf(map.InterfaceMethods, interfaceMethod);
if (index == -1)
{
//this should literally be impossible
}
return map.TargetMethods[index];
More Related Contents:
- How do I get the path of the assembly the code is in?
- Set object property using reflection
- How to Load an Assembly to AppDomain with all references recursively?
- How can I get all classes within a namespace?
- How to get a list of properties with a given attribute?
- How to determine if a type implements a specific generic interface type
- Purpose of Activator.CreateInstance with example?
- Mapping object to dictionary and vice versa
- Reflection – Getting the generic arguments from a System.Type instance
- Using Case/Switch and GetType to determine the object [duplicate]
- Use reflection to invoke an overridden base method
- What is the “cost” of .NET reflection? [duplicate]
- Get a generic method without using GetMethods
- How to check whether an object has certain method/property?
- GetProperties() to return all properties for an interface inheritance hierarchy
- Invoking methods with optional parameters through reflection
- Resolve Type from Class Name in a Different Assembly
- Discovering derived types using reflection
- Check if a property exists in a class
- How to copy value from class X to class Y with the same property name in c#?
- Get member to which attribute was applied from inside attribute constructor?
- Using GetProperties() with BindingFlags.DeclaredOnly in .NET Reflection
- How Can I add properties to a class on runtime in C#?
- How can I create an Action delegate from MethodInfo?
- Can I get parameter names/values procedurally from the currently executing function?
- How can I protect my private funcs against reflection executing?
- Using Reflection to create a DataTable from a Class?
- Get private Properties/Method of base-class with reflection
- Reflecting a private field from a base class
- Two Types not equal that should be