static int set_OnOpen(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); BestHTTP.WebSocket.WebSocket obj = (BestHTTP.WebSocket.WebSocket)o; BestHTTP.WebSocket.OnWebSocketOpenDelegate arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (BestHTTP.WebSocket.OnWebSocketOpenDelegate)ToLua.CheckObject(L, 2, typeof(BestHTTP.WebSocket.OnWebSocketOpenDelegate)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(BestHTTP.WebSocket.OnWebSocketOpenDelegate), func) as BestHTTP.WebSocket.OnWebSocketOpenDelegate; } obj.OnOpen = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index OnOpen on a nil value" : e.Message)); } }
static int get_OnOpen(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); BestHTTP.WebSocket.WebSocket obj = (BestHTTP.WebSocket.WebSocket)o; BestHTTP.WebSocket.OnWebSocketOpenDelegate ret = obj.OnOpen; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index OnOpen on a nil value" : e.Message)); } }
static int set_OnOpen(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); BestHTTP.WebSocket.WebSocket obj = (BestHTTP.WebSocket.WebSocket)o; BestHTTP.WebSocket.OnWebSocketOpenDelegate arg0 = (BestHTTP.WebSocket.OnWebSocketOpenDelegate)ToLua.CheckDelegate <BestHTTP.WebSocket.OnWebSocketOpenDelegate>(L, 2); obj.OnOpen = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index OnOpen on a nil value")); } }