コード例 #1
0
    static int set_onItemSelected(IntPtr L)
    {
        object o = null;

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

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

            obj.onItemSelected = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index onItemSelected on a nil value" : e.Message));
        }
    }
コード例 #2
0
    static int get_onItemSelected(IntPtr L)
    {
        object o = null;

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