コード例 #1
0
        static int _m_AddCustomEventListener(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Maria.EventDispatcher __cl_gen_to_be_invoked = (Maria.EventDispatcher)translator.FastGetCSObj(L, 1);


            try {
                {
                    string eventName = LuaAPI.lua_tostring(L, 2);
                    Maria.EventListenerCustom.OnEventCustomHandler callback = translator.GetDelegate <Maria.EventListenerCustom.OnEventCustomHandler>(L, 3);
                    object addition = translator.GetObject(L, 4, typeof(object));

                    Maria.EventListenerCustom __cl_gen_ret = __cl_gen_to_be_invoked.AddCustomEventListener(eventName, callback, addition);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #2
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 2 && translator.Assignable <Maria.Context>(L, 2))
                {
                    Maria.Context ctx = (Maria.Context)translator.GetObject(L, 2, typeof(Maria.Context));

                    Maria.EventDispatcher __cl_gen_ret = new Maria.EventDispatcher(ctx);
                    translator.Push(L, __cl_gen_ret);

                    return(1);
                }
            }
            catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to Maria.EventDispatcher constructor!"));
        }
コード例 #3
0
        static int _m_AddCmdEventListener(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Maria.EventDispatcher __cl_gen_to_be_invoked = (Maria.EventDispatcher)translator.FastGetCSObj(L, 1);


            try {
                {
                    Maria.EventListenerCmd listener = (Maria.EventListenerCmd)translator.GetObject(L, 2, typeof(Maria.EventListenerCmd));

                    __cl_gen_to_be_invoked.AddCmdEventListener(listener);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #4
0
        static int _m_PubCustomEvent(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Maria.EventDispatcher __cl_gen_to_be_invoked = (Maria.EventDispatcher)translator.FastGetCSObj(L, 1);


            try {
                {
                    string eventName = LuaAPI.lua_tostring(L, 2);
                    object ud        = translator.GetObject(L, 3, typeof(object));

                    __cl_gen_to_be_invoked.PubCustomEvent(eventName, ud);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #5
0
        static int _m_UnsubCustomEventListener(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            Maria.EventDispatcher __cl_gen_to_be_invoked = (Maria.EventDispatcher)translator.FastGetCSObj(L, 1);


            try {
                {
                    Maria.EventListenerCustom listener = (Maria.EventListenerCustom)translator.GetObject(L, 2, typeof(Maria.EventListenerCustom));

                    bool __cl_gen_ret = __cl_gen_to_be_invoked.UnsubCustomEventListener(listener);
                    LuaAPI.lua_pushboolean(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
コード例 #6
0
        static int _m_DispatchCmdEvent(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Maria.EventDispatcher __cl_gen_to_be_invoked = (Maria.EventDispatcher)translator.FastGetCSObj(L, 1);



                {
                    Maria.Command cmd = (Maria.Command)translator.GetObject(L, 2, typeof(Maria.Command));

                    __cl_gen_to_be_invoked.DispatchCmdEvent(cmd);



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }