public DownloadViewModel(INetEase netEase, INetwork network, IDownloadQueue downloadQueue, IDialog dialog) : base(netEase, network, dialog) { this.downloadQueue = downloadQueue; this.downloads = this.downloadQueue.GetAll(); this.downloadQueue.QueueChanged += this.DownloadQueue_QueueChanged; }
public SearchResultViewModel( INetEase netEase, INetwork network, IDialog dialog, IPlayer player, IDownloadQueue downloaderQueue) : base(netEase, network, dialog) { this.player = player; this.downloaderQueue = downloaderQueue; }
public ListSongViewModel(IUserDialogs userDialog, INetEase netEase, IDownloadQueue downloadQueue, IPlayer player, INetwork network, IDialog dialog) : base(netEase, network, dialog) { this.userDialog = userDialog; this.downloadAll = false; this.downloadQueue = downloadQueue; this.player = player; this.player.ProgressChanged -= this.Player_ProgressChanged; this.player.ProgressChanged += this.Player_ProgressChanged; this.player.SongFinished -= this.Player_SongFinished; this.player.SongFinished += this.Player_SongFinished; this.historyItems = new List <SongListInitItem>(); }
/// <summary> /// Initializes a new instance of the <see cref="DownloadManager"/> class. /// </summary> /// <param name="mediator">Defines a mediator to encapsulate request/response and publishing interaction patterns.</param> /// <param name="signalRService"></param> /// <param name="plexAuthenticationService">.</param> /// <param name="fileMerger">.</param> /// <param name="userSettings"></param> /// <param name="downloadQueue">Used to retrieve the next <see cref="DownloadTask"/> from the <see cref="DownloadQueue"/>.</param> /// <param name="notificationsService"></param> /// <param name="plexDownloadClientFactory"></param> public DownloadManager( IMediator mediator, ISignalRService signalRService, IPlexAuthenticationService plexAuthenticationService, IFileMerger fileMerger, IUserSettings userSettings, IDownloadQueue downloadQueue, INotificationsService notificationsService, Func <DownloadTask, PlexDownloadClient> plexDownloadClientFactory) : base(mediator, signalRService) { _plexAuthenticationService = plexAuthenticationService; _fileMerger = fileMerger; _userSettings = userSettings; _notificationsService = notificationsService; _plexDownloadClientFactory = plexDownloadClientFactory; _downloadQueue = downloadQueue; _fileMerger.FileMergeProgressObservable.Subscribe(OnFileMergeProgress); }