Ejemplo n.º 1
0
    static int DownLoadTask(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        DownLoadFromWeb obj  = LuaScriptMgr.GetNetObject <DownLoadFromWeb>(L, 1);
        object          arg0 = LuaScriptMgr.GetVarObject(L, 2);

        obj.DownLoadTask(arg0);
        return(0);
    }
Ejemplo n.º 2
0
    static int DownloadCompleted(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        DownLoadFromWeb         obj  = LuaScriptMgr.GetNetObject <DownLoadFromWeb>(L, 1);
        object                  arg0 = LuaScriptMgr.GetVarObject(L, 2);
        AsyncCompletedEventArgs arg1 = LuaScriptMgr.GetNetObject <AsyncCompletedEventArgs>(L, 3);

        obj.DownloadCompleted(arg0, arg1);
        return(0);
    }
Ejemplo n.º 3
0
    static int ProgressChanged(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        DownLoadFromWeb obj  = LuaScriptMgr.GetNetObject <DownLoadFromWeb>(L, 1);
        object          arg0 = LuaScriptMgr.GetVarObject(L, 2);
        DownloadProgressChangedEventArgs arg1 = LuaScriptMgr.GetNetObject <DownloadProgressChangedEventArgs>(L, 3);

        obj.ProgressChanged(arg0, arg1);
        return(0);
    }
Ejemplo n.º 4
0
    static int DownLoad(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 6);
        DownLoadFromWeb obj  = LuaScriptMgr.GetNetObject <DownLoadFromWeb>(L, 1);
        string          arg0 = LuaScriptMgr.GetLuaString(L, 2);
        string          arg1 = LuaScriptMgr.GetLuaString(L, 3);
        string          arg2 = LuaScriptMgr.GetLuaString(L, 4);
        string          arg3 = LuaScriptMgr.GetLuaString(L, 5);
        string          arg4 = LuaScriptMgr.GetLuaString(L, 6);

        obj.DownLoad(arg0, arg1, arg2, arg3, arg4);
        return(0);
    }
Ejemplo n.º 5
0
    public void DownLoadTask(object ParObject)
    {
        DownLoadFromWeb _this = (DownLoadFromWeb)ParObject;

        if (_this != null)
        {
            WebClient client = new WebClient();
            client.DownloadFileAsync(new  System.Uri(_this.uri), _this.savePath);
            //下载完成回调
            client.DownloadFileCompleted += _this.DownloadCompleted;
            //下载进度条
            //if(!string.IsNullOrEmpty(this.callback_progress))
            client.DownloadProgressChanged += _this.ProgressChanged;
        }
    }
Ejemplo n.º 6
0
    static int _CreateDownLoadFromWeb(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            DownLoadFromWeb obj = new DownLoadFromWeb();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: DownLoadFromWeb.New");
        }

        return(0);
    }
Ejemplo n.º 7
0
    static int get_luaName(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        if (o == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name luaName");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index luaName on a nil value");
            }
        }

        DownLoadFromWeb obj = (DownLoadFromWeb)o;

        LuaScriptMgr.Push(L, obj.luaName);
        return(1);
    }
Ejemplo n.º 8
0
    static int set_savePath(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        if (o == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name savePath");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index savePath on a nil value");
            }
        }

        DownLoadFromWeb obj = (DownLoadFromWeb)o;

        obj.savePath = LuaScriptMgr.GetString(L, 3);
        return(0);
    }
Ejemplo n.º 9
0
    static int set_callback_completed(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        if (o == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name callback_completed");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index callback_completed on a nil value");
            }
        }

        DownLoadFromWeb obj = (DownLoadFromWeb)o;

        obj.callback_completed = LuaScriptMgr.GetString(L, 3);
        return(0);
    }
Ejemplo n.º 10
0
    static int set_luaM(IntPtr L)
    {
        object o = LuaScriptMgr.GetLuaObject(L, 1);

        if (o == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name luaM");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index luaM on a nil value");
            }
        }

        DownLoadFromWeb obj = (DownLoadFromWeb)o;

        obj.luaM = LuaScriptMgr.GetNetObject <LuaManager>(L, 3);
        return(0);
    }