/// <summary> /// Stop torrent from being active /// </summary> /// <param name="deleteFiles"></param> public void Remove(bool deleteFiles) { string magnet = TorrentSource.Magnet; TorrentSession.RemoveTorrent(Handle, deleteFiles); TorrentDatabase.Remove(magnet); torrents.Remove(this); }
/// <summary> /// Continues all unifinished torrents /// </summary> public async static void ContinueUnfinished() { var torrents = TorrentDatabase.Load(); torrents = torrents.Where(x => x.HasFinished == false).ToList(); foreach (var item in torrents) { TorrentDatabase.Remove(item.Magnet); TorrentDownloader downloader = new TorrentDownloader(item); await downloader.Download(); } }
private void Remove_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { this.Visibility = Visibility.Collapsed; TorrentDatabase.Remove(torrent.Magnet); }