Author: alanmc
Date: 2007-05-01 16:08:45 -0400 (Tue, 01 May 2007)
New Revision: 76543

Added:
   trunk/bitsharp/src/MonoTorrent/Collections/BEncodedKeyValuePair.cs
   trunk/bitsharp/src/MonoTorrent/Collections/BlockCollection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/IBEncodedValueCollection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/ITorrentWatcherCollection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/PeerCollection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/PeerConnectionIDCollection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/PieceCollection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/StringCollection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/TorrentManagerCollection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/TraceListenerCollection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/UInt32Collection.cs
   trunk/bitsharp/src/MonoTorrent/Collections/WaitHandleCollection.cs
Modified:
   trunk/bitsharp/src/MonoTorrent/BEncoding/BEncodedNumber.cs
Log:
Added missing files

Modified: trunk/bitsharp/src/MonoTorrent/BEncoding/BEncodedNumber.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/BEncoding/BEncodedNumber.cs  2007-05-01 
20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/BEncoding/BEncodedNumber.cs  2007-05-01 
20:08:45 UTC (rev 76543)
@@ -146,13 +146,13 @@
 
         public int CompareTo(object other)
         {
-            if(object is BEncodedNumber)
+            if(other is BEncodedNumber)
                 return CompareTo((BEncodedNumber)other);
 
-            if(obj is int)
+            if (other is int)
                 return CompareTo((int)other);
 
-            if(obj is long)
+            if (other is long)
                 return CompareTo((long)other);
 
             return -1;

Added: trunk/bitsharp/src/MonoTorrent/Collections/BEncodedKeyValuePair.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/BEncodedKeyValuePair.cs  
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/BEncodedKeyValuePair.cs  
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,25 @@
+using System;
+using System.Text;
+
+using MonoTorrent.BEncoding;
+
+namespace MonoTorrent
+{
+    public class BEncodedKeyValuePair
+    {
+        private BEncodedString key;
+        private IBEncodedValue _value;
+
+        public BEncodedString Key
+        {
+            get { return key; }
+            set { key = value; }
+        }
+
+        public IBEncodedValue Value
+        {
+            get { return _value; }
+            set { _value = value; }
+        }
+    }
+}


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/BEncodedKeyValuePair.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/BlockCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/BlockCollection.cs       
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/BlockCollection.cs       
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,170 @@
+using System;
+using System.Text;
+using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+using MonoTorrent.Client;
+
+namespace MonoTorrent
+{
+       public class BlockCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<Block> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public BlockCollection()
+               {
+#if NET_2_0
+                       list = new List<Block>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public BlockCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<Block>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public Block this[int index]
+               {
+                       get { return (Block)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(Block value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(Block value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(Block value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, Block value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(Block value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((Block)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((Block)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((Block)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (Block)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((Block)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (Block)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/BlockCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/IBEncodedValueCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/IBEncodedValueCollection.cs      
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/IBEncodedValueCollection.cs      
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,171 @@
+using System;
+using System.Text;
+using System.Collections;
+
+using MonoTorrent.BEncoding;
+
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+namespace MonoTorrent
+{
+       public class IBEncodedValueCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<IBEncodedValue> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public IBEncodedValueCollection()
+               {
+#if NET_2_0
+                       list = new List<IBEncodedValue>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public IBEncodedValueCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<IBEncodedValue>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public IBEncodedValue this[int index]
+               {
+                       get { return (IBEncodedValue)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(IBEncodedValue value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(IBEncodedValue value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(IBEncodedValue value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, IBEncodedValue value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(IBEncodedValue value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((IBEncodedValue)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((IBEncodedValue)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((IBEncodedValue)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (IBEncodedValue)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((IBEncodedValue)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (IBEncodedValue)value; }
+               }
+
+               #endregion
+    }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/IBEncodedValueCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/ITorrentWatcherCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/ITorrentWatcherCollection.cs     
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/ITorrentWatcherCollection.cs     
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,170 @@
+using System;
+using System.Text;
+using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+using MonoTorrent.Common;
+
+namespace MonoTorrent
+{
+       public class ITorrentWatcherCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<ITorrentWatcher> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public ITorrentWatcherCollection()
+               {
+#if NET_2_0
+                       list = new List<ITorrentWatcher>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public ITorrentWatcherCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<ITorrentWatcher>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public ITorrentWatcher this[int index]
+               {
+                       get { return (ITorrentWatcher)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(ITorrentWatcher value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(ITorrentWatcher value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(ITorrentWatcher value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, ITorrentWatcher value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(ITorrentWatcher value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((ITorrentWatcher)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((ITorrentWatcher)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((ITorrentWatcher)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (ITorrentWatcher)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((ITorrentWatcher)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (ITorrentWatcher)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/ITorrentWatcherCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/PeerCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/PeerCollection.cs        
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/PeerCollection.cs        
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,170 @@
+using System;
+using System.Text;
+using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+using MonoTorrent.Client;
+
+namespace MonoTorrent
+{
+       public class PeerCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<Peer> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public PeerCollection()
+               {
+#if NET_2_0
+                       list = new List<Peer>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public PeerCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<Peer>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public Peer this[int index]
+               {
+                       get { return (Peer)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(Peer value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(Peer value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(Peer value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, Peer value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(Peer value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((Peer)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((Peer)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((Peer)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (Peer)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((Peer)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (Peer)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/PeerCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/PeerConnectionIDCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/PeerConnectionIDCollection.cs    
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/PeerConnectionIDCollection.cs    
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,170 @@
+using System;
+using System.Text;
+using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+using MonoTorrent.Client;
+
+namespace MonoTorrent
+{
+       public class PeerConnectionIDCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<PeerConnectionID> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public PeerConnectionIDCollection()
+               {
+#if NET_2_0
+                       list = new List<PeerConnectionID>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public PeerConnectionIDCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<PeerConnectionID>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public PeerConnectionID this[int index]
+               {
+                       get { return (PeerConnectionID)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(PeerConnectionID value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(PeerConnectionID value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(PeerConnectionID value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, PeerConnectionID value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(PeerConnectionID value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((PeerConnectionID)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((PeerConnectionID)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((PeerConnectionID)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (PeerConnectionID)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((PeerConnectionID)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (PeerConnectionID)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/PeerConnectionIDCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/PieceCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/PieceCollection.cs       
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/PieceCollection.cs       
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,170 @@
+using System;
+using System.Text;
+using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+using MonoTorrent.Client;
+
+namespace MonoTorrent
+{
+       public class PieceCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<Piece> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public PieceCollection()
+               {
+#if NET_2_0
+                       list = new List<Piece>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public PieceCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<Piece>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public Piece this[int index]
+               {
+                       get { return (Piece)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(Piece value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(Piece value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(Piece value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, Piece value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(Piece value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((Piece)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((Piece)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((Piece)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (Piece)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((Piece)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (Piece)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/PieceCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/StringCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/StringCollection.cs      
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/StringCollection.cs      
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,168 @@
+using System;
+using System.Text;
+using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+namespace MonoTorrent
+{
+       public class stringCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<string> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public stringCollection()
+               {
+#if NET_2_0
+                       list = new List<string>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public stringCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<string>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public string this[int index]
+               {
+                       get { return (string)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(string value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(string value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(string value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, string value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(string value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((string)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((string)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((string)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (string)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((string)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (string)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/StringCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/TorrentManagerCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/TorrentManagerCollection.cs      
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/TorrentManagerCollection.cs      
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,170 @@
+using System;
+using System.Text;
+using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+using MonoTorrent.Client;
+
+namespace MonoTorrent
+{
+       public class TorrentManagerCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<TorrentManager> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public TorrentManagerCollection()
+               {
+#if NET_2_0
+                       list = new List<TorrentManager>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public TorrentManagerCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<TorrentManager>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public TorrentManager this[int index]
+               {
+                       get { return (TorrentManager)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(TorrentManager value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(TorrentManager value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(TorrentManager value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, TorrentManager value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(TorrentManager value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((TorrentManager)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((TorrentManager)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((TorrentManager)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (TorrentManager)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((TorrentManager)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (TorrentManager)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/TorrentManagerCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/TraceListenerCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/TraceListenerCollection.cs       
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/TraceListenerCollection.cs       
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,169 @@
+using System;
+using System.Text;
+using System.Collections;
+using System.Diagnostics;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+namespace MonoTorrent
+{
+       public class TraceListenerCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<TraceListener> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public TraceListenerCollection()
+               {
+#if NET_2_0
+                       list = new List<TraceListener>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public TraceListenerCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<TraceListener>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public TraceListener this[int index]
+               {
+                       get { return (TraceListener)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(TraceListener value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(TraceListener value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(TraceListener value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, TraceListener value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(TraceListener value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((TraceListener)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((TraceListener)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((TraceListener)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (TraceListener)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((TraceListener)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (TraceListener)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/TraceListenerCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/UInt32Collection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/UInt32Collection.cs      
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/UInt32Collection.cs      
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,168 @@
+using System;
+using System.Text;
+using System.Collections;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+namespace MonoTorrent
+{
+       public class UInt32Collection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<UInt32> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public UInt32Collection()
+               {
+#if NET_2_0
+                       list = new List<UInt32>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public UInt32Collection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<UInt32>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+               public UInt32 this[int index]
+               {
+                       get { return (UInt32)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(UInt32 value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(UInt32 value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(UInt32 value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, UInt32 value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(UInt32 value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((UInt32)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((UInt32)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((UInt32)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (UInt32)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((UInt32)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (UInt32)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/UInt32Collection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/bitsharp/src/MonoTorrent/Collections/WaitHandleCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/WaitHandleCollection.cs  
2007-05-01 20:06:15 UTC (rev 76542)
+++ trunk/bitsharp/src/MonoTorrent/Collections/WaitHandleCollection.cs  
2007-05-01 20:08:45 UTC (rev 76543)
@@ -0,0 +1,174 @@
+using System;
+using System.Text;
+using System.Collections;
+using System.Threading;
+#if NET_2_0
+using System.Collections.Generic;
+#endif
+
+namespace MonoTorrent
+{
+       public class WaitHandleCollection : IList
+       {
+               #region Private Fields
+
+#if NET_2_0
+               private List<WaitHandle> list;
+#else
+               private ArrayList list;
+#endif
+
+               #endregion Private Fields
+
+
+               #region Constructors
+
+               public WaitHandleCollection()
+               {
+#if NET_2_0
+                       list = new List<WaitHandle>();
+#else
+                       list = new ArrayList();
+#endif
+               }
+
+               public WaitHandleCollection(int capacity)
+               {
+#if NET_2_0
+                       list = new List<WaitHandle>(capacity);
+#else
+                       list = new ArrayList(capacity);
+#endif
+               }
+
+               #endregion
+
+
+               #region Methods
+
+        public WaitHandle[] ToArray()
+        {
+            return this.ToArray();
+        }
+
+               public WaitHandle this[int index]
+               {
+                       get { return (WaitHandle)list[index]; }
+                       set { list[index] = value; }
+               }
+
+               public int Add(WaitHandle value)
+               {
+#if NET_2_0
+                       list.Add(value);
+                       return 0;
+#else
+                       return this.list.Add(value);
+#endif
+               }
+
+               public void Clear()
+               {
+                       this.list.Clear();
+               }
+
+               public bool Contains(WaitHandle value)
+               {
+                       return list.Contains(value);
+               }
+
+               public void CopyTo(Array array, int index)
+               {
+                       ((IList)list).CopyTo(array, index);
+               }
+
+               public int Count
+               {
+                       get { return list.Count; }
+               }
+
+               public IEnumerator GetEnumerator()
+               {
+                       return list.GetEnumerator();
+               }
+
+               public int IndexOf(WaitHandle value)
+               {
+                       return list.IndexOf(value);
+               }
+
+               public void Insert(int index, WaitHandle value)
+               {
+                       list.Insert(index, value);
+               }
+
+               public bool IsSynchronized
+               {
+                       get { return ((IList)list).IsSynchronized; }
+               }
+
+               public void Remove(WaitHandle value)
+               {
+                       list.Remove(value);
+               }
+
+               public void RemoveAt(int index)
+               {
+                       RemoveAt(index);
+               }
+
+               public object SyncRoot
+               {
+                       get { return ((IList)list).SyncRoot; }
+               }
+
+               #endregion Methods
+
+
+               #region Explicit Implementation
+
+               int IList.Add(object value)
+               {
+                       return Add((WaitHandle)value);
+               }
+
+               int IList.IndexOf(object value)
+               {
+                       return IndexOf((WaitHandle)value);
+               }
+
+               bool IList.Contains(object value)
+               {
+                       return Contains((WaitHandle)value);
+               }
+
+               void IList.Insert(int index, object value)
+               {
+                       Insert(index, (WaitHandle)value);
+               }
+
+               bool IList.IsFixedSize
+               {
+                       get { return ((IList)list).IsFixedSize; }
+               }
+
+               bool IList.IsReadOnly
+               {
+                       get { return ((IList)list).IsReadOnly; }
+
+               }
+
+               void IList.Remove(object value)
+               {
+                       Remove((WaitHandle)value);
+               }
+
+               object IList.this[int index]
+               {
+                       get { return this[index]; }
+                       set { this[index] = (WaitHandle)value; }
+               }
+
+               #endregion
+       }
+}
\ No newline at end of file


Property changes on: 
trunk/bitsharp/src/MonoTorrent/Collections/WaitHandleCollection.cs
___________________________________________________________________
Name: svn:eol-style
   + native

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

Reply via email to