Author: alanmc
Date: 2007-02-11 12:17:00 -0500 (Sun, 11 Feb 2007)
New Revision: 72628

Modified:
   trunk/bitsharp/src/MonoTorrent.Interface/MonoTorrent.Interface.csproj
   
trunk/bitsharp/src/MonoTorrent.Interface/src/MonoTorrent.Interface/Model/TorrentsList.cs
Log:
update to fix compatibility

Modified: trunk/bitsharp/src/MonoTorrent.Interface/MonoTorrent.Interface.csproj
===================================================================
--- trunk/bitsharp/src/MonoTorrent.Interface/MonoTorrent.Interface.csproj       
2007-02-11 17:15:05 UTC (rev 72627)
+++ trunk/bitsharp/src/MonoTorrent.Interface/MonoTorrent.Interface.csproj       
2007-02-11 17:17:00 UTC (rev 72628)
@@ -83,11 +83,11 @@
   </ItemGroup>
   <ItemGroup>
     <ProjectReference 
Include="..\MonoTorrent.Client\MonoTorrent.Client.csproj">
-      <Project>{BA61F399-BE56-445D-9C61-3A617F4BABEA}</Project>
+      <Project>{43EFAA6E-4602-4DA2-8DE7-A6C33030C2DB}</Project>
       <Name>MonoTorrent.Client</Name>
     </ProjectReference>
     <ProjectReference 
Include="..\MonoTorrent.Common\MonoTorrent.Common.csproj">
-      <Project>{B49212EE-36F4-42DA-BA8C-6589DCA535D9}</Project>
+      <Project>{80852421-60A9-42CD-AC7C-47A4CFC973BC}</Project>
       <Name>MonoTorrent.Common</Name>
     </ProjectReference>
   </ItemGroup>

Modified: 
trunk/bitsharp/src/MonoTorrent.Interface/src/MonoTorrent.Interface/Model/TorrentsList.cs
===================================================================
--- 
trunk/bitsharp/src/MonoTorrent.Interface/src/MonoTorrent.Interface/Model/TorrentsList.cs
    2007-02-11 17:15:05 UTC (rev 72627)
+++ 
trunk/bitsharp/src/MonoTorrent.Interface/src/MonoTorrent.Interface/Model/TorrentsList.cs
    2007-02-11 17:17:00 UTC (rev 72628)
@@ -39,16 +39,20 @@
 
         private Dictionary<TreeIter, TorrentManager> rowsToTorrents;
 
-        public TorrentsList() :  base(
-                typeof(string), typeof(string), typeof(string), 
+        public TorrentsList()
+            : base(
                 typeof(string), typeof(string), typeof(string),
                 typeof(string), typeof(string), typeof(string),
+                typeof(string), typeof(string), typeof(string),
                 typeof(string), typeof(string))
         {
             this.rowsToTorrents = new Dictionary<TreeIter, TorrentManager>();
-            ClientEngine.ConnectionManager.OnPeerConnectionChanged
+            ClientEngine.ConnectionManager.PeerConnected
                     += OnPeerChange;
-            //ClientEngine.connectionManager.OnPeerMessages += OnPeerChange;
+            ClientEngine.ConnectionManager.PeerDisconnected
+                    += OnPeerChange;
+            ClientEngine.ConnectionManager.PeerMessageTransferred
+                    += OnPeerChange;
         }
 
         public TreeIter AddTorrent(TorrentManager torrent)
@@ -56,9 +60,9 @@
             TreeIter row = Append();
             UpdateRow(row, torrent);
             rowsToTorrents.Add(row, torrent);
-            torrent.OnPieceHashed += OnTorrentChange;
-            torrent.OnPeersAdded += OnTorrentChange;
-            torrent.OnTorrentStateChanged += OnTorrentStateChange;
+            torrent.PieceHashed += OnTorrentChange;
+            torrent.PeersFound += OnTorrentChange;
+            torrent.TorrentStateChanged += OnTorrentStateChange;
             //torrent.PieceManager.OnPieceChanged += OnTorrentChange;
             return row;
         }
@@ -66,8 +70,8 @@
         public bool RemoveTorrent(ref TreeIter row)
         {
             //rowsToTorrents[row].PieceManager.OnPieceChanged -= 
OnTorrentChange;
-            rowsToTorrents[row].OnPeersAdded -= OnTorrentChange;
-            rowsToTorrents[row].OnPieceHashed -= OnTorrentChange;
+            rowsToTorrents[row].PeersFound -= OnTorrentChange;
+            rowsToTorrents[row].PieceHashed -= OnTorrentChange;
             rowsToTorrents.Remove(row);
             return Remove(ref row);
         }
@@ -113,9 +117,21 @@
 
         private void OnPeerChangeSync(object sender, EventArgs args)
         {
-            PeerConnectionID connection = (PeerConnectionID) sender;
-            TorrentManager torrent = connection.TorrentManager;
+            TorrentManager torrent=null;
+            if(args is PeerConnectionEventArgs)
+            {
+                PeerConnectionEventArgs e = args as PeerConnectionEventArgs;
+                torrent = e.PeerID.TorrentManager;
+
+            }
+            else if (args is PeerMessageEventArgs)
+            {
+                return;
+                //PeerConnectionID id = sender as PeerConnectionID;
+                //torrent = id.TorrentManager;
+            }
             UpdateStats(FindRow(torrent), torrent);
+
         }
 
         private TreeIter FindRow(TorrentManager torrent)

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to