static int AddItem(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes <FairyGUI.EventCallback1>(L, 3))
            {
                FairyGUI.PopupMenu      obj  = (FairyGUI.PopupMenu)ToLua.CheckObject <FairyGUI.PopupMenu>(L, 1);
                string                  arg0 = ToLua.CheckString(L, 2);
                FairyGUI.EventCallback1 arg1 = (FairyGUI.EventCallback1)ToLua.ToObject(L, 3);
                FairyGUI.GButton        o    = obj.AddItem(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <FairyGUI.EventCallback0>(L, 3))
            {
                FairyGUI.PopupMenu      obj  = (FairyGUI.PopupMenu)ToLua.CheckObject <FairyGUI.PopupMenu>(L, 1);
                string                  arg0 = ToLua.CheckString(L, 2);
                FairyGUI.EventCallback0 arg1 = (FairyGUI.EventCallback0)ToLua.ToObject(L, 3);
                FairyGUI.GButton        o    = obj.AddItem(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.PopupMenu.AddItem"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#2
0
 public static void OnClick(this IUnirxBind gobjectSub, FairyGUI.EventCallback1 onClick)
 {
     gobjectSub.GetGObject().onClick.Add((arg) =>
     {
         onClick(arg);
     });
 }
    static int AddItemAt(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.PopupMenu), typeof(string), typeof(int), typeof(FairyGUI.EventCallback1)))
            {
                FairyGUI.PopupMenu obj  = (FairyGUI.PopupMenu)ToLua.ToObject(L, 1);
                string             arg0 = ToLua.ToString(L, 2);
                int arg1 = (int)LuaDLL.lua_tonumber(L, 3);
                FairyGUI.EventCallback1 arg2 = null;
                LuaTypes funcType4           = LuaDLL.lua_type(L, 4);

                if (funcType4 != LuaTypes.LUA_TFUNCTION)
                {
                    arg2 = (FairyGUI.EventCallback1)ToLua.ToObject(L, 4);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 4);
                    arg2 = DelegateFactory.CreateDelegate(typeof(FairyGUI.EventCallback1), func) as FairyGUI.EventCallback1;
                }

                FairyGUI.GButton o = obj.AddItemAt(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.PopupMenu), typeof(string), typeof(int), typeof(FairyGUI.EventCallback0)))
            {
                FairyGUI.PopupMenu obj  = (FairyGUI.PopupMenu)ToLua.ToObject(L, 1);
                string             arg0 = ToLua.ToString(L, 2);
                int arg1 = (int)LuaDLL.lua_tonumber(L, 3);
                FairyGUI.EventCallback0 arg2 = null;
                LuaTypes funcType4           = LuaDLL.lua_type(L, 4);

                if (funcType4 != LuaTypes.LUA_TFUNCTION)
                {
                    arg2 = (FairyGUI.EventCallback0)ToLua.ToObject(L, 4);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 4);
                    arg2 = DelegateFactory.CreateDelegate(typeof(FairyGUI.EventCallback0), func) as FairyGUI.EventCallback0;
                }

                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 RemoveCapture(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 2);
            FairyGUI.EventListener  obj  = (FairyGUI.EventListener)ToLua.CheckObject(L, 1, typeof(FairyGUI.EventListener));
            FairyGUI.EventCallback1 arg0 = null;
            LuaTypes funcType2           = LuaDLL.lua_type(L, 2);

            if (funcType2 != LuaTypes.LUA_TFUNCTION)
            {
                arg0 = (FairyGUI.EventCallback1)ToLua.CheckObject(L, 2, typeof(FairyGUI.EventCallback1));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 2);
                arg0 = DelegateFactory.CreateDelegate(typeof(FairyGUI.EventCallback1), func) as FairyGUI.EventCallback1;
            }

            obj.RemoveCapture(arg0);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#5
0
        static StackObject *AddItemAt_3(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, 4);

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

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @index = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.String @caption = (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, 4);
            FairyGUI.PopupMenu instance_of_this_method = (FairyGUI.PopupMenu) typeof(FairyGUI.PopupMenu).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.AddItemAt(@caption, @index, @callback);

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
示例#6
0
    static int RemoveEventListener(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes <FairyGUI.EventCallback0>(L, 3))
            {
                FairyGUI.EventDispatcher obj = (FairyGUI.EventDispatcher)ToLua.CheckObject <FairyGUI.EventDispatcher>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                FairyGUI.EventCallback0 arg1 = (FairyGUI.EventCallback0)ToLua.ToObject(L, 3);
                obj.RemoveEventListener(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <FairyGUI.EventCallback1>(L, 3))
            {
                FairyGUI.EventDispatcher obj = (FairyGUI.EventDispatcher)ToLua.CheckObject <FairyGUI.EventDispatcher>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                FairyGUI.EventCallback1 arg1 = (FairyGUI.EventCallback1)ToLua.ToObject(L, 3);
                obj.RemoveEventListener(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.EventDispatcher.RemoveEventListener"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    static int Add(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes <FairyGUI.EventCallback0>(L, 2))
            {
                FairyGUI.EventListener  obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
                FairyGUI.EventCallback0 arg0 = (FairyGUI.EventCallback0)ToLua.ToObject(L, 2);
                obj.Add(arg0);
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes <FairyGUI.EventCallback1>(L, 2))
            {
                FairyGUI.EventListener  obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
                FairyGUI.EventCallback1 arg0 = (FairyGUI.EventCallback1)ToLua.ToObject(L, 2);
                obj.Add(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.EventListener.Add"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#8
0
        static int _m_AddItemForce(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    string _caption = LuaAPI.lua_tostring(L, 2);
                    FairyGUI.EventCallback1 _callback = translator.GetDelegate <FairyGUI.EventCallback1>(L, 3);

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



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
    static int AddEventListener(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.EventDispatcher), typeof(string), typeof(FairyGUI.EventCallback1)))
            {
                FairyGUI.EventDispatcher obj = (FairyGUI.EventDispatcher)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                FairyGUI.EventCallback1 arg1 = null;
                LuaTypes funcType3           = LuaDLL.lua_type(L, 3);

                if (funcType3 != LuaTypes.LUA_TFUNCTION)
                {
                    arg1 = (FairyGUI.EventCallback1)ToLua.ToObject(L, 3);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 3);
                    arg1 = DelegateFactory.CreateDelegate(typeof(FairyGUI.EventCallback1), func) as FairyGUI.EventCallback1;
                }

                obj.AddEventListener(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.EventDispatcher), typeof(string), typeof(FairyGUI.EventCallback0)))
            {
                FairyGUI.EventDispatcher obj = (FairyGUI.EventDispatcher)ToLua.ToObject(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                FairyGUI.EventCallback0 arg1 = null;
                LuaTypes funcType3           = LuaDLL.lua_type(L, 3);

                if (funcType3 != LuaTypes.LUA_TFUNCTION)
                {
                    arg1 = (FairyGUI.EventCallback0)ToLua.ToObject(L, 3);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 3);
                    arg1 = DelegateFactory.CreateDelegate(typeof(FairyGUI.EventCallback0), func) as FairyGUI.EventCallback0;
                }

                obj.AddEventListener(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.EventDispatcher.AddEventListener"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#10
0
    public static Delegate FairyGUI_EventCallback1(LuaFunction func)
    {
        if (func == null)
        {
            FairyGUI.EventCallback1 fn = delegate { };
            return(fn);
        }

        FairyGUI.EventCallback1 d = (new FairyGUI_EventCallback1_Event(func)).Call;
        return(d);
    }
示例#11
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!"));
        }
示例#12
0
 static int RemoveCapture(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         FairyGUI.EventListener  obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
         FairyGUI.EventCallback1 arg0 = (FairyGUI.EventCallback1)ToLua.CheckDelegate <FairyGUI.EventCallback1>(L, 2);
         obj.RemoveCapture(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int AddCapture(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         FairyGUI.EventDispatcher obj = (FairyGUI.EventDispatcher)ToLua.CheckObject <FairyGUI.EventDispatcher>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         FairyGUI.EventCallback1 arg1 = (FairyGUI.EventCallback1)ToLua.CheckDelegate <FairyGUI.EventCallback1>(L, 3);
         obj.AddCapture(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
示例#14
0
        static StackObject *Set_8(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, 2);

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

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

            instance_of_this_method.Set(@callback);

            return(__ret);
        }
示例#15
0
    public static Delegate FairyGUI_EventCallback1(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            FairyGUI.EventCallback1 fn = delegate(FairyGUI.EventContext param0) { };
            return(fn);
        }

        if (!flag)
        {
            FairyGUI.EventCallback1 d = (new FairyGUI_EventCallback1_Event(func)).Call;
            return(d);
        }
        else
        {
            FairyGUI.EventCallback1 d = (new FairyGUI_EventCallback1_Event(func, self)).CallWithSelf;
            return(d);
        }
    }
        static int _m_AddEventListener(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.AddEventListener(
                        _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.AddEventListener(
                        _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.AddEventListener!"));
        }
示例#17
0
    static int Add(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                FairyGUI.EventListener  obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
                FairyGUI.EventCallback1 arg0 = (FairyGUI.EventCallback1)ToLua.CheckDelegate <FairyGUI.EventCallback1>(L, 2);
                obj.Add(arg0);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <LuaInterface.LuaTable>(L, 3))
            {
                FairyGUI.EventListener obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
                LuaFunction            arg0 = ToLua.CheckLuaFunction(L, 2);
                LuaTable arg1 = ToLua.ToLuaTable(L, 3);
                obj.Add(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <FairyGUI.GComponent>(L, 3))
            {
                FairyGUI.EventListener obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
                LuaFunction            arg0 = ToLua.CheckLuaFunction(L, 2);
                FairyGUI.GComponent    arg1 = (FairyGUI.GComponent)ToLua.ToObject(L, 3);
                obj.Add(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.EventListener.Add"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
        static StackObject *RemoveEventListener_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.EventCallback1 @callback = (FairyGUI.EventCallback1) typeof(FairyGUI.EventCallback1).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags) 8);
            __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), (CLR.Utils.Extensions.TypeFlags) 0);
            __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), (CLR.Utils.Extensions.TypeFlags) 0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.RemoveEventListener(@strType, @callback);

            return(__ret);
        }
        static int _m_AddCapture(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



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

                    gen_to_be_invoked.AddCapture(_callback);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
示例#20
0
    public FairyGUI.EventCallback1 FairyGUI_EventCallback1(LuaFunction func, LuaTable self, bool flag)
    {
        if (func == null)
        {
            FairyGUI.EventCallback1 fn = delegate(FairyGUI.EventContext param0) { };
            return(fn);
        }

        if (!flag)
        {
            FairyGUI_EventCallback1_Event target = new FairyGUI_EventCallback1_Event(func);
            FairyGUI.EventCallback1       d      = target.Call;
            target.method = d.Method;
            return(d);
        }
        else
        {
            FairyGUI_EventCallback1_Event target = new FairyGUI_EventCallback1_Event(func, self);
            FairyGUI.EventCallback1       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 _m_RemoveCapture(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


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



                {
                    string _strType = LuaAPI.lua_tostring(L, 2);
                    FairyGUI.EventCallback1 _callback = translator.GetDelegate <FairyGUI.EventCallback1>(L, 3);

                    gen_to_be_invoked.RemoveCapture(_strType, _callback);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static internal int checkDelegate(IntPtr l, int p, out FairyGUI.EventCallback1 ua)
        {
            int op = extractFunction(l, p);

            if (LuaDLL.lua_isnil(l, p))
            {
                ua = null;
                return(op);
            }
            else if (LuaDLL.lua_isuserdata(l, p) == 1)
            {
                ua = (FairyGUI.EventCallback1)checkObj(l, p);
                return(op);
            }
            LuaDelegate ld;

            checkType(l, -1, out ld);
            if (ld.d != null)
            {
                ua = (FairyGUI.EventCallback1)ld.d;
                return(op);
            }
            LuaDLL.lua_pop(l, 1);

            l  = LuaState.get(l).L;
            ua = (FairyGUI.EventContext a1) =>
            {
                int error = pushTry(l);

                pushValue(l, a1);
                ld.pcall(1, error);
                LuaDLL.lua_settop(l, error - 1);
            };
            ld.d = ua;
            return(op);
        }
示例#24
0
 void Push_FairyGUI_EventCallback1(IntPtr L, FairyGUI.EventCallback1 o)
 {
     ToLua.Push(L, o);
 }