Ejemplo n.º 1
0
 public static HttpDownload GetTaskByInfo(DownloadInfo info)
 {
     return(new HttpDownload()
     {
         Url = info.DownloadUrl,
         DownloadPath = info.DownloadPath,
         Info = info,
     });
 }
Ejemplo n.º 2
0
        public void UpdateTask(DownloadInfo info)
        {
            if (info == null)
            {
                return;
            }
            var data = GetDownloadingDataByPath(info.DownloadPath);

            data.Info = info;
            data.Save();
        }
Ejemplo n.º 3
0
        public DownloadInfo CreateData()
        {
            var response = GetResponse();

            if (response == null)
            {
                throw new NullReferenceException("下载链接已失效");
            }

            var info = new DownloadInfo
            {
                ContentLength = response.ContentLength,
                DownloadUrl   = Url,
                DownloadPath  = DownloadPath,
            };

            info.Init();
            return(info);
        }
Ejemplo n.º 4
0
 public NextResult(DownloadInfo info, int errorCode, string errorMessage)
 {
     Info         = info;
     ErrorCode    = errorCode;
     ErrorMessage = errorMessage;
 }
Ejemplo n.º 5
0
 public long GetFileIdByDownloadInfo(DownloadInfo info)
 {
     return(GetFileIdByPath(info.DownloadPath));
 }