|
|
@ -11,6 +11,7 @@ using DownKyi.Images;
|
|
|
|
using DownKyi.Models;
|
|
|
|
using DownKyi.Models;
|
|
|
|
using DownKyi.Utils;
|
|
|
|
using DownKyi.Utils;
|
|
|
|
using DownKyi.ViewModels.DownloadManager;
|
|
|
|
using DownKyi.ViewModels.DownloadManager;
|
|
|
|
|
|
|
|
using Hardcodet.Wpf.TaskbarNotification;
|
|
|
|
using Prism.Services.Dialogs;
|
|
|
|
using Prism.Services.Dialogs;
|
|
|
|
using System;
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
@ -19,15 +20,15 @@ using System.IO;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DownKyi.Services.Download
|
|
|
|
namespace DownKyi.Services.Download
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public abstract class DownloadService
|
|
|
|
public abstract class DownloadService
|
|
|
|
{
|
|
|
|
{
|
|
|
|
protected string Tag = "DownloadService";
|
|
|
|
protected string Tag = "DownloadService";
|
|
|
|
|
|
|
|
protected TaskbarIcon _notifyIcon;
|
|
|
|
protected IDialogService dialogService;
|
|
|
|
protected IDialogService dialogService;
|
|
|
|
|
|
|
|
|
|
|
|
protected ObservableCollection<DownloadingItem> downloadingList;
|
|
|
|
protected ObservableCollection<DownloadingItem> downloadingList;
|
|
|
|
protected ObservableCollection<DownloadedItem> downloadedList;
|
|
|
|
protected ObservableCollection<DownloadedItem> downloadedList;
|
|
|
|
|
|
|
|
|
|
|
@ -673,6 +674,7 @@ namespace DownKyi.Services.Download
|
|
|
|
DownloadFinishedSort finishedSort = SettingsManager.GetInstance().GetDownloadFinishedSort();
|
|
|
|
DownloadFinishedSort finishedSort = SettingsManager.GetInstance().GetDownloadFinishedSort();
|
|
|
|
App.SortDownloadedList(finishedSort);
|
|
|
|
App.SortDownloadedList(finishedSort);
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
|
|
|
|
_notifyIcon.ShowBalloonTip("下载完成",$"{downloadedItem.DownloadBase.Name}", BalloonIcon.Info);
|
|
|
|
}));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (OperationCanceledException e)
|
|
|
|
catch (OperationCanceledException e)
|
|
|
@ -795,7 +797,6 @@ namespace DownKyi.Services.Download
|
|
|
|
downloadStorageService.UpdateDownloaded(item);
|
|
|
|
downloadStorageService.UpdateDownloaded(item);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 启动基本下载服务
|
|
|
|
/// 启动基本下载服务
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -803,6 +804,7 @@ namespace DownKyi.Services.Download
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tokenSource = new CancellationTokenSource();
|
|
|
|
tokenSource = new CancellationTokenSource();
|
|
|
|
cancellationToken = tokenSource.Token;
|
|
|
|
cancellationToken = tokenSource.Token;
|
|
|
|
|
|
|
|
_notifyIcon = new TaskbarIcon();
|
|
|
|
workTask = Task.Run(DoWork);
|
|
|
|
workTask = Task.Run(DoWork);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|