예제 #1
0
    static int set_oncopyCallback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YX_APIManage            obj  = (YX_APIManage)o;
            YX_APIManage.onCopyCall arg0 = null;
            LuaTypes funcType2           = LuaDLL.lua_type(L, 2);

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

            obj.oncopyCallback = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index oncopyCallback on a nil value" : e.Message));
        }
    }
예제 #2
0
    static int onCopy(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 3);
            YX_APIManage            obj       = (YX_APIManage)ToLua.CheckObject(L, 1, typeof(YX_APIManage));
            string                  arg0      = ToLua.CheckString(L, 2);
            YX_APIManage.onCopyCall arg1      = null;
            LuaTypes                funcType3 = LuaDLL.lua_type(L, 3);

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

            obj.onCopy(arg0, arg1);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #3
0
    static int get_oncopyCallback(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            YX_APIManage            obj = (YX_APIManage)o;
            YX_APIManage.onCopyCall ret = obj.oncopyCallback;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index oncopyCallback on a nil value" : e.Message));
        }
    }