Пример #1
0
    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));
        }
    }
Пример #2
0
 static public int AddItemAt(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (matchType(l, argc, 2, typeof(string), typeof(int), typeof(FairyGUI.EventCallback1)))
         {
             FairyGUI.PopupMenu self = (FairyGUI.PopupMenu)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             FairyGUI.EventCallback1 a3;
             LuaDelegation.checkDelegate(l, 4, out a3);
             var ret = self.AddItemAt(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (matchType(l, argc, 2, typeof(string), typeof(int), typeof(FairyGUI.EventCallback0)))
         {
             FairyGUI.PopupMenu self = (FairyGUI.PopupMenu)checkSelf(l);
             System.String      a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             FairyGUI.EventCallback0 a3;
             LuaDelegation.checkDelegate(l, 4, out a3);
             var ret = self.AddItemAt(a1, a2, a3);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    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));
        }
    }