protected virtual TypeInfo SearchFirstDeclaringType() { var parameters = GetParameters(); var result = methodInfo.GetBaseDefinition().DeclaringType; if (result == null) { throw new NotSupportedException(); } foreach (var interfaceType in result.GetInterfaces()) { foreach (var interfaceMethodInfo in interfaceType.GetMethods()) { if (interfaceMethodInfo.Name != methodInfo.Name) { continue; } if (interfaceMethodInfo.GetParameters().Length != parameters.Length) { continue; } if (parameters.Length == 0) { return(TypeInfo.Get(interfaceType)); } var interfaceMethodParameters = interfaceMethodInfo.GetParameters(); for (var i = 0; i < parameters.Length; i++) { if (parameters[i].ParameterType.GetActualType() != interfaceMethodParameters[i].ParameterType) { break; } if (i == parameters.Length - 1) { return(TypeInfo.Get(interfaceType)); } } } } return(TypeInfo.Get(result)); }
static int _m_GetBaseDefinition(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); System.Reflection.MethodInfo gen_to_be_invoked = (System.Reflection.MethodInfo)translator.FastGetCSObj(L, 1); { System.Reflection.MethodInfo gen_ret = gen_to_be_invoked.GetBaseDefinition( ); translator.Push(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
public override System.Reflection.MethodInfo GetBaseDefinition() { return(methodInfo.GetBaseDefinition()); }