protected virtual MethodInfo GetMethodImpl()
{
if ((this._methodBase == null) || !(this._methodBase is MethodInfo))
{
IRuntimeMethodInfo method = this.FindMethodHandle();
RuntimeType declaringType = RuntimeMethodHandle.GetDeclaringType(method);
if ((RuntimeTypeHandle.IsGenericTypeDefinition(declaringType) || RuntimeTypeHandle.HasInstantiation(declaringType)) && ((RuntimeMethodHandle.GetAttributes(method) & MethodAttributes.Static) == MethodAttributes.PrivateScope))
{
if (!(this._methodPtrAux == IntPtr.Zero))
{
declaringType = (RuntimeType)base.GetType().GetMethod("Invoke").GetParameters()[0].ParameterType;
}
else
{
Type type = this._target.GetType();
Type genericTypeDefinition = declaringType.GetGenericTypeDefinition();
while (true)
{
if (type.IsGenericType && (type.GetGenericTypeDefinition() == genericTypeDefinition))
{
break;
}
type = type.BaseType;
}
declaringType = type as RuntimeType;
}
}
this._methodBase = (MethodInfo)RuntimeType.GetMethodBase(declaringType, method);
}
return((MethodInfo)this._methodBase);
}