Exemplo n.º 1
0
        /// <summary>
        /// Creates an instance using the specified <see cref="IBencodeParser"/> for parsing
        /// the torrent <see cref="BDictionary"/>.
        /// </summary>
        /// <param name="bencodeParser">The parser used for parsing the torrent <see cref="BDictionary"/>.</param>
        /// <param name="torrentParserMode">The parsing mode to use.</param>
        public TorrentParser(IBencodeParser bencodeParser, TorrentParserMode torrentParserMode)
        {
            if (bencodeParser == null)
            {
                throw new ArgumentNullException(nameof(bencodeParser));
            }

            BencodeParser = bencodeParser;
            ParseMode     = torrentParserMode;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an instance with the specified <see cref="TorrentParserMode"/> using a default <see cref="IBencodeParser"/>.
 /// </summary>
 /// <param name="torrentParserMode">The parser used for parsing the torrent <see cref="BDictionary"/>.</param>
 public TorrentParser(TorrentParserMode torrentParserMode)
     : this(new BencodeParser(), torrentParserMode)
 {
 }