/************************************************************************/ /* 右键选择下载 */ /************************************************************************/ private void ToolStripMenuItemDownload_Click(object sender, EventArgs e) { foreach (ListViewItem item in listView1.SelectedItems) { String s = item.SubItems[1].Text; DMItem selected = itemList.Find(it => { if (it.Title.Equals(s)) { return(true); } else { return(false); } }); SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "BT 文件(*.torrent)|*.torrent"; sfd.RestoreDirectory = true; sfd.FileName = selected.TorrentName; if (sfd.ShowDialog() != DialogResult.OK) { return; } source.getTorrent(selected.TorrentUrl, sfd.FileName); MessageBox.Show(this, sfd.FileName + "\n保存完成!", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/************************************************************************/ /* 右键-复制-种子,复制种子下载页面地址。 */ /************************************************************************/ private void MouseMenuTorrentCopy_Click(object sender, EventArgs e) { foreach (ListViewItem item in listView1.SelectedItems) { String s = item.SubItems[1].Text; DMItem selected = itemList.Find(it => { if (it.Title.Equals(s)) { return(true); } else { return(false); } }); Clipboard.SetText(selected.DetailUrl); } }
/************************************************************************/ /* 右键选择详细,打开新窗口,显示新番具体内容。 */ /************************************************************************/ private void MouseMenuDetail_Click(object sender, EventArgs e) { foreach (ListViewItem item in listView1.SelectedItems) { String s = item.SubItems[1].Text; DMItem selected = itemList.Find(it => { if (it.Title.Equals(s)) { return(true); } else { return(false); } }); new DetailWeb(selected.DetailUrl, selected.Title, source).Show(); } }
/************************************************************************/ /* 右键选择打开 */ /************************************************************************/ private void ToolStripMenuItemOpen_Click(object sender, EventArgs e) { foreach (ListViewItem item in listView1.SelectedItems) { String s = item.SubItems[1].Text; DMItem selected = itemList.Find(it => { if (it.Title.Equals(s)) { return(true); } else { return(false); } }); source.getTorrent(selected.TorrentUrl, EXEPath + "/torrent/" + selected.TorrentName); System.Diagnostics.Process.Start(EXEPath + "/torrent/" + selected.TorrentName); } }
/************************************************************************/ /* 鼠标右键,搜索当前选中的新番组+当前新番或搜索词 */ /************************************************************************/ private void ToolStripMenuItemTeam_Click(object sender, EventArgs e) { if (currentRK == ResourcesKind.KTXP) { MessageBox.Show("KTXP资源不支持该功能。"); return; } if (currentXinFan == null) { MessageBox.Show("缺少关键字。"); return; } ListViewItem item = listView1.SelectedItems[0]; String s = item.SubItems[1].Text; DMItem selected = itemList.Find(it => { if (it.Title.Equals(s)) { return(true); } else { return(false); } }); if (selected.TeamID == null) { MessageBox.Show("缺少字幕组id。"); return; } // String url = @"http://share.dmhy.org/topics/list?keyword=" // + currentXinFan + "+team_id:" + selected.TeamID; GetUpdate(Kind.ALL, currentXinFan + "+team_id:" + selected.TeamID); }