static internal int checkDelegate(IntPtr l, int p, out UITable.OnReposition 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 = (UITable.OnReposition)checkObj(l, p); return(op); } LuaDelegate ld; checkType(l, -1, out ld); if (ld.d != null) { ua = (UITable.OnReposition)ld.d; return(op); } LuaDLL.lua_pop(l, 1); l = LuaState.get(l).L; ua = () => { int error = pushTry(l); ld.pcall(0, error); LuaDLL.lua_settop(l, error - 1); }; ld.d = ua; return(op); }
static int set_onReposition(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UITable obj = (UITable)o; UITable.OnReposition arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (UITable.OnReposition)ToLua.CheckObject(L, 2, typeof(UITable.OnReposition)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(UITable.OnReposition), func) as UITable.OnReposition; } obj.onReposition = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onReposition on a nil value" : e.Message)); } }
public static Delegate UITable_OnReposition(LuaFunction func) { UITable.OnReposition d = () => { func.Call(); }; return(d); }
static int set_onReposition(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UITable obj = (UITable)o; UITable.OnReposition arg0 = (UITable.OnReposition)ToLua.CheckDelegate <UITable.OnReposition>(L, 2); obj.onReposition = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onReposition on a nil value")); } }
static int get_onReposition(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); UITable obj = (UITable)o; UITable.OnReposition ret = obj.onReposition; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index onReposition on a nil value")); } }
private static int get_onReposition(IntPtr L) { object obj = null; int result; try { obj = ToLua.ToObject(L, 1); UITable uITable = (UITable)obj; UITable.OnReposition onReposition = uITable.onReposition; ToLua.Push(L, onReposition); result = 1; } catch (Exception ex) { result = LuaDLL.toluaL_exception(L, ex, (obj != null) ? ex.Message : "attempt to index onReposition on a nil value"); } return(result); }