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

            data.Info = info;
            data.Save();
        }
예제 #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);
        }
예제 #4
0
 public NextResult(DownloadInfo info, int errorCode, string errorMessage)
 {
     Info         = info;
     ErrorCode    = errorCode;
     ErrorMessage = errorMessage;
 }
예제 #5
0
 public long GetFileIdByDownloadInfo(DownloadInfo info)
 {
     return(GetFileIdByPath(info.DownloadPath));
 }