static int _m_DispatchEvent(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); FairyGUI.IEventDispatcher gen_to_be_invoked = (FairyGUI.IEventDispatcher)translator.FastGetCSObj(L, 1); { FairyGUI.EventContext _context = (FairyGUI.EventContext)translator.GetObject(L, 2, typeof(FairyGUI.EventContext)); bool gen_ret = gen_to_be_invoked.DispatchEvent( _context); LuaAPI.lua_pushboolean(L, gen_ret); return(1); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } }
static int _m_RemoveEventListener(RealStatePtr L) { try { ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L); FairyGUI.IEventDispatcher gen_to_be_invoked = (FairyGUI.IEventDispatcher)translator.FastGetCSObj(L, 1); int gen_param_count = LuaAPI.lua_gettop(L); if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <FairyGUI.EventCallback0>(L, 3)) { string _strType = LuaAPI.lua_tostring(L, 2); FairyGUI.EventCallback0 _callback = translator.GetDelegate <FairyGUI.EventCallback0>(L, 3); gen_to_be_invoked.RemoveEventListener( _strType, _callback); return(0); } if (gen_param_count == 3 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && translator.Assignable <FairyGUI.EventCallback1>(L, 3)) { string _strType = LuaAPI.lua_tostring(L, 2); FairyGUI.EventCallback1 _callback = translator.GetDelegate <FairyGUI.EventCallback1>(L, 3); gen_to_be_invoked.RemoveEventListener( _strType, _callback); return(0); } } catch (System.Exception gen_e) { return(LuaAPI.luaL_error(L, "c# exception:" + gen_e)); } return(LuaAPI.luaL_error(L, "invalid arguments to FairyGUI.IEventDispatcher.RemoveEventListener!")); }