static int _m_RemoveEventListener(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                FairyGUI.EventDispatcher gen_to_be_invoked = (FairyGUI.EventDispatcher)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.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);
                }
                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);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to FairyGUI.EventDispatcher.RemoveEventListener!"));
        }
示例#2
0
        static int _m_AddItemAt(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                FairyGUI.PopupMenu gen_to_be_invoked = (FairyGUI.PopupMenu)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && translator.Assignable <FairyGUI.EventCallback0>(L, 4))
                {
                    string _caption = LuaAPI.lua_tostring(L, 2);
                    int    _index   = LuaAPI.xlua_tointeger(L, 3);
                    FairyGUI.EventCallback0 _callback = translator.GetDelegate <FairyGUI.EventCallback0>(L, 4);

                    FairyGUI.GButton gen_ret = gen_to_be_invoked.AddItemAt(_caption, _index, _callback);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && (LuaAPI.lua_isnil(L, 2) || LuaAPI.lua_type(L, 2) == LuaTypes.LUA_TSTRING) && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3) && translator.Assignable <FairyGUI.EventCallback1>(L, 4))
                {
                    string _caption = LuaAPI.lua_tostring(L, 2);
                    int    _index   = LuaAPI.xlua_tointeger(L, 3);
                    FairyGUI.EventCallback1 _callback = translator.GetDelegate <FairyGUI.EventCallback1>(L, 4);

                    FairyGUI.GButton gen_ret = gen_to_be_invoked.AddItemAt(_caption, _index, _callback);
                    translator.Push(L, 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 FairyGUI.PopupMenu.AddItemAt!"));
        }
        static StackObject *AddEventListener_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            FairyGUI.EventCallback0 @callback = (FairyGUI.EventCallback0) typeof(FairyGUI.EventCallback0).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.String @strType = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            FairyGUI.EventDispatcher instance_of_this_method = (FairyGUI.EventDispatcher) typeof(FairyGUI.EventDispatcher).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.AddEventListener(@strType, @callback);

            return(__ret);
        }
示例#4
0
    public static Delegate FairyGUI_EventCallback0(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            FairyGUI.EventCallback0 fn = delegate() { };
            return(fn);
        }

        if (!flag)
        {
            FairyGUI_EventCallback0_Event target = new FairyGUI_EventCallback0_Event(func);
            FairyGUI.EventCallback0       d      = target.Call;
            target.method = d.Method;
            return(d);
        }
        else
        {
            FairyGUI_EventCallback0_Event target = new FairyGUI_EventCallback0_Event(func, self);
            FairyGUI.EventCallback0       d      = target.CallWithSelf;
            target.method = d.Method;
            return(d);
        }
    }
        static int _m_Set(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                FairyGUI.EventListener gen_to_be_invoked = (FairyGUI.EventListener)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <FairyGUI.EventCallback1>(L, 2))
                {
                    FairyGUI.EventCallback1 _callback = translator.GetDelegate <FairyGUI.EventCallback1>(L, 2);

                    gen_to_be_invoked.Set(_callback);



                    return(0);
                }
                if (gen_param_count == 2 && translator.Assignable <FairyGUI.EventCallback0>(L, 2))
                {
                    FairyGUI.EventCallback0 _callback = translator.GetDelegate <FairyGUI.EventCallback0>(L, 2);

                    gen_to_be_invoked.Set(_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.EventListener.Set!"));
        }
    static int AddItemAt(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 4 && TypeChecker.CheckTypes <FairyGUI.EventCallback1>(L, 4))
            {
                FairyGUI.PopupMenu obj  = (FairyGUI.PopupMenu)ToLua.CheckObject <FairyGUI.PopupMenu>(L, 1);
                string             arg0 = ToLua.CheckString(L, 2);
                int arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                FairyGUI.EventCallback1 arg2 = (FairyGUI.EventCallback1)ToLua.ToObject(L, 4);
                FairyGUI.GButton        o    = obj.AddItemAt(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4 && TypeChecker.CheckTypes <FairyGUI.EventCallback0>(L, 4))
            {
                FairyGUI.PopupMenu obj  = (FairyGUI.PopupMenu)ToLua.CheckObject <FairyGUI.PopupMenu>(L, 1);
                string             arg0 = ToLua.CheckString(L, 2);
                int arg1 = (int)LuaDLL.luaL_checknumber(L, 3);
                FairyGUI.EventCallback0 arg2 = (FairyGUI.EventCallback0)ToLua.ToObject(L, 4);
                FairyGUI.GButton        o    = obj.AddItemAt(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.PopupMenu.AddItemAt"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
        static int _m_Set(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                FairyGUI.EventListener gen_to_be_invoked = (FairyGUI.EventListener)translator.FastGetCSObj(L, 1);



                {
                    FairyGUI.EventCallback0 _callback = translator.GetDelegate <FairyGUI.EventCallback0>(L, 2);

                    gen_to_be_invoked.Set(
                        _callback);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
 void Push_FairyGUI_EventCallback0(IntPtr L, FairyGUI.EventCallback0 o)
 {
     ToLua.Push(L, o);
 }