Boo.Lang.Compiler.Steps.EmitAssembly.GetMappedMethodInfo C# (CSharp) Метод

GetMappedMethodInfo() приватный Метод

Retrieves the MethodInfo for a method as mapped on a generic type.
private GetMappedMethodInfo ( IType targetType, IMethod source ) : MethodInfo
targetType IType
source IMethod
Результат System.Reflection.MethodInfo
        private MethodInfo GetMappedMethodInfo(IType targetType, IMethod source)
        {
            var mi = GetMethodInfo(source);
            if (mi.DeclaringType.IsGenericTypeDefinition)
                return GetConstructedMethodInfo(targetType, mi);

            // HACK: .NET Reflection doesn't allow calling TypeBuilder.GetMethod(Type, MethodInfo)
            // on types that aren't generic definitions (like open constructed types), so we have to
            // manually find the corresponding MethodInfo on the declaring type's definition before
            // mapping it
            var definition = mi.DeclaringType.GetGenericTypeDefinition();
            var correspondingMethod = Array.Find(definition.GetMethods(), it => it.MetadataToken == mi.MetadataToken);
            return GetConstructedMethodInfo(targetType, correspondingMethod);
        }
EmitAssembly