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 ReportAbandonFile(DownloadInfo d, string reason) { try { AbandonFiles++; lbAbandonFiles.Text = strAbandonFiles + AbandonFiles; AbandonFile a = new AbandonFile(); a.Info = d; a.Reason = reason; AbandonFileList.Add(a); if (AbandonFileList.Count > 100) { AbandonFileList.RemoveAt(0); } try { a.Keyword = hunter.projectInfo.strategy.GetKeyword(d.Keyword); } catch { a.Keyword = "[获取出错]"; } WriteAbandonFile(a); } catch (Exception ex) { WriteException(ex); } }