Ejemplo n.º 1
0
    static int RemoveEventHander(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 3);
            TGNetService obj  = (TGNetService)ToLua.CheckObject(L, 1, typeof(TGNetService));
            string       arg0 = ToLua.CheckString(L, 2);
            TGNetService.NetEventHanlder arg1 = null;
            LuaTypes funcType3 = LuaDLL.lua_type(L, 3);

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

            obj.RemoveEventHander(arg0, arg1);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 2
0
    static int set_Handler(IntPtr L)
    {
        object o = null;

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

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

            obj.Handler = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Handler on a nil value" : e.Message));
        }
    }
Ejemplo n.º 3
0
    public static Delegate TGNetService_NetEventHanlder(LuaFunction func)
    {
        if (func == null)
        {
            TGNetService.NetEventHanlder fn = delegate { return(false); };
            return(fn);
        }

        TGNetService.NetEventHanlder d = (new TGNetService_NetEventHanlder_Event(func)).Call;
        return(d);
    }
Ejemplo n.º 4
0
    static int get_Handler(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            TGNetService.NetRequest      obj = (TGNetService.NetRequest)o;
            TGNetService.NetEventHanlder ret = obj.Handler;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Handler on a nil value" : e.Message));
        }
    }
Ejemplo n.º 5
0
 public static Delegate TGNetService_NetEventHanlder_Self(LuaFunction func, LuaTable self)
 {
     TGNetService.NetEventHanlder d = (new TGNetService_NetEventHanlder_Event_Self(func, self)).Call;
     return(d);
 }