Esempio n. 1
0
        public void Add(NetDiskFile file, string path)
        {
            if (Contains(path))
            {
                return;
            }


            _info.Tasks.Add(new TaskInfo()
            {
                DownloadFileInfo = file,
                DownloadPath     = path,
            });

            var data = new DownloadingFileData()
            {
                Info         = null,
                DownloadPath = path,
                FileInfo     = file,
            };

            data.Save();
            _info.DownloadingList.Add(data);
            Save();
        }
Esempio n. 2
0
        public NextResult CreateData(DownloadingFileData info, DownloadResult result)
        {
            try
            {
                var httpInfo = HttpDownload.CreateTaskInfo(result.Urls, info.DownloadPath);

                info.Info = httpInfo;
                info.Save();


                return(new NextResult(httpInfo, 0, string.Empty));
            }
            catch (Exception ex)
            {
                return(null);
            }
        }