Author: alanmc
Date: 2007-06-25 18:46:28 -0400 (Mon, 25 Jun 2007)
New Revision: 80736
Modified:
trunk/bitsharp/src/MonoTorrent/Common/Torrent.cs
trunk/bitsharp/src/MonoTorrent/Common/TorrentCreator.cs
Log:
Added ability to generate in-memory torrent
Modified: trunk/bitsharp/src/MonoTorrent/Common/Torrent.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Common/Torrent.cs 2007-06-25 22:25:12 UTC
(rev 80735)
+++ trunk/bitsharp/src/MonoTorrent/Common/Torrent.cs 2007-06-25 22:46:28 UTC
(rev 80736)
@@ -589,7 +589,7 @@
}
- private static Torrent Load(BEncodedDictionary torrentInformation)
+ internal static Torrent Load(BEncodedDictionary torrentInformation)
{
Torrent t = new Torrent();
foreach (KeyValuePair<BEncodedString, BEncodedValue> keypair in
torrentInformation)
Modified: trunk/bitsharp/src/MonoTorrent/Common/TorrentCreator.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Common/TorrentCreator.cs 2007-06-25
22:25:12 UTC (rev 80735)
+++ trunk/bitsharp/src/MonoTorrent/Common/TorrentCreator.cs 2007-06-25
22:46:28 UTC (rev 80736)
@@ -372,6 +372,15 @@
}
+ public Torrent Create()
+ {
+ Reset();
+ CreateDict();
+
+ return Torrent.Load(this.torrent);
+ }
+
+
///<summary>
///creates an BencodedDictionary.
///</summary>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches