protected virtual void ClearDownload(ClearMessage msg) { }
/// <summary> /// Clears a selected task /// </summary> /// <param name="msg"></param> protected override void ClearDownload(ClearMessage msg) { foreach (var task in DownloadingItems.Where(task => task.DataContext == msg.DownloadItemViewModel).ToList()) { var viewModel = (DownloadItemViewModel)task.DataContext; viewModel.Dispose(); DownloadingItems.Remove(task); } }
/// <summary> /// Should be called upon application shutdown to cancel any ongoing downloads /// </summary> /// <param name="msg"></param> protected override void ClearDownload(ClearMessage msg) { // No specified 'DownloadItemViewModel' means that all instances of it should be canceled if (msg.DownloadItemViewModel == null) { Cancel(); Dispose(); videoDownloader = null; } }