示例#1
0
 public ManagedDownloaderTokenImpl(IDownloaderManager manager, IDownloader downloader)
 {
     _manager = manager;
     if (!manager.Add(downloader))
     {
         throw new InvalidOperationException();
     }
     _downloader = downloader;
 }
        public DownloadedViewModel(IUnityContainer container, IDownloaderManager downloaderManager) : base(container)
        {
            _downloaderManager = downloaderManager;

            EmptyAllRecordCommand = new RelayCommand(
                () =>
            {
                AcceleriderUser.GetNetDiskUsers().ForEach(item => item.ClearDownloadFiles());
                TransferredFiles.Clear();
            },
                () => TransferredFiles?.Any() ?? false);

            EventAggregator.GetEvent <TransferItemCompletedEvent>().Subscribe(
                item => TransferredFiles.Add(item),
                Prism.Events.ThreadOption.UIThread,
                true,
                _ => TransferredFiles != null);
        }