private void OnPlayOrDownloadOrCancelClick(object sender, RoutedEventArgs e) { ErrorReporting.Log("OnPlayOrDownloadOrCancelClick"); var lecture = (Lecture)((Button)sender).DataContext; ErrorReporting.Log("Lecture = " + lecture.Title + " [" + lecture.Id + "]"); if (videoLazyBlocks.ContainsKey(lecture.Id)) { ErrorReporting.Log("Already fetching video url"); } else if (lecture.DownloadInfo.Downloading) { ErrorReporting.Log("Cancelling download"); ((DownloadInfo)lecture.DownloadInfo).Monitor.RequestCancel(); } else if (lecture.DownloadInfo.Downloaded) { ErrorReporting.Log("Launching downloaded video"); VideoPage.LaunchDownloadedVideo(this, lecture.DownloadInfo); } else { StartDownload(lecture); } }
private void OnPlayClick(object sender, RoutedEventArgs e) { ErrorReporting.Log("OnPlayClick"); var downloadInfo = (DownloadInfo)((Button)sender).DataContext; ErrorReporting.Log("Course = " + downloadInfo.CourseTopicName + " [" + downloadInfo.CourseId + "] Lecture = " + downloadInfo.LectureTitle + " [" + downloadInfo.LectureId + "]"); VideoPage.LaunchDownloadedVideo(this, downloadInfo); }