// Instantiated as active download.
        public DownloadViewModel(ItemViewModel item, string filename)
            : this() {
            _downloadHelper = new DownloadHelper(Settings.Default.DownloadTimeout);
            _downloadHelper.DownloadProgressChanged += _downloadHelper_DownloadProgressChanged;

            Title = item.Title;
            FeedTitle = item.FeedTitle;
            FileName = filename;
            Url = item.PodcastUrl;
            State = DownloadState.Downloading;
            StartTime = DateTime.Now;
            _podcastType = DownloadHelper.GetPodcastType(FileName);

            // Timer for UI updates.
            _updateTimer = new DispatcherTimer();
            _updateTimer.Interval = DownloadUpdateInternal;
            _updateTimer.Tick += _updateTimer_Tick;

            StartAsync(); // Start download.
        }
Exemple #2
0
 public IManager GetManager(PodcastType podcastType) =>
 _managers?.FirstOrDefault(a => a.Type == podcastType);