コード例 #1
0
        private void SendAddFiles()
        {
            var data = new TorrentAddedData(Location);
            data.Files.AddRange(Torrents.Where(torrent => torrent.IsAdd && torrent.IsFile).Select(x => x.TorrentData));
            data.URIs.AddRange(Torrents.Where(torrent => torrent.IsAdd && !torrent.IsFile).Select(x => x.TorrentData));

            _eventAggregator.GetEvent<AddTorrent>().Publish(data);
        }
コード例 #2
0
        public void AddTorrents(TorrentAddedData data)
        {
            var location = data.Location.EscapeSlashes();
            foreach (var torrent in data.Files)
            {
                _torrentClient.AddFile(torrent, location);
            }

            foreach (var uri in data.URIs)
            {
                _torrentClient.AddURL(uri, location);
            }
        }