public void CloseProject() { if (hunter != null) { hunter.CloseHunter(); } if (Paused) { Toogle(); } hunter = null; miPause.Enabled = false; miOpen.Visible = true; miClose.Visible = false; foreach (var m in tsStrategies) { m.Enabled = true; } DownloadedList.Clear(); AbandonFileList.Clear(); AbandonLinkList.Clear(); ExceptionList.Clear(); WriteMessage("任务已关闭。"); Text = "Hunter 3"; }
void RemoveVideo(DownloadedVideo videoItem) { string path = videoItem.VideoPath; int index = DownloadedList.IndexOf(videoItem); System.Diagnostics.Debug.WriteLine("Menu item delete click and its index in collection is: " + index); DownloadedList.RemoveAt(index); videoHelper.RemoveVideoFile(videoItem.VideoName); }
private void CreateNewDownloadedVideo(string name) { DownloadedVideo video = new DownloadedVideo { VideoName = name, VideoPath = "", VideoTime = "Downloading...", IsDownloading = true, VideoThumbnail = ImageSource.FromFile("downloading.png") }; DownloadedList.Add(video); }
void ReportDownloadedInfo(DownloadInfo d) { try { Downloads++; lbDownloads.Text = strDownloads + Downloads; DownloadedList.Add(d); if (DownloadedList.Count > 100) { DownloadedList.RemoveAt(0); } } catch (Exception ex) { WriteException(ex); } }