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