Author: alanmc
Date: 2007-04-30 17:28:53 -0400 (Mon, 30 Apr 2007)
New Revision: 76509
Modified:
trunk/bitsharp/src/MonoTorrent/Collections/IntCollection.cs
trunk/bitsharp/src/MonoTorrent/Collections/TrackerCollection.cs
trunk/bitsharp/src/MonoTorrent/Collections/UntypedCollection.cs
Log:
Fixed compilation ;)
Modified: trunk/bitsharp/src/MonoTorrent/Collections/IntCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/IntCollection.cs 2007-04-30
21:13:57 UTC (rev 76508)
+++ trunk/bitsharp/src/MonoTorrent/Collections/IntCollection.cs 2007-04-30
21:28:53 UTC (rev 76509)
@@ -1,3 +1,4 @@
+
using System;
using System.Text;
using System.Collections;
@@ -7,7 +8,7 @@
namespace MonoTorrent
{
- public class intCollection : IList
+ public class IntCollection : IList
{
#region Private Fields
@@ -22,14 +23,22 @@
#region Constructors
- public intCollection()
+ public IntCollection()
{
+#if NET_2_0
+ list = new List<int>();
+#else
list = new ArrayList();
+#endif
}
- public intCollection(int capacity)
+ public IntCollection(int capacity)
{
+#if NET_2_0
+ list = new List<int>(capacity);
+#else
list = new ArrayList(capacity);
+#endif
}
#endregion
@@ -43,9 +52,14 @@
set { list[index] = value; }
}
- public void Add(int value)
+ public int Add(int value)
{
- this.list.Add(value);
+#if NET_2_0
+ list.Add(value);
+ return 0;
+#else
+ return this.list.Add(value);
+#endif
}
public void Clear()
@@ -60,7 +74,7 @@
public void CopyTo(Array array, int index)
{
- list.CopyTo(array, index);
+ ((IList)list).CopyTo(array, index);
}
public int Count
@@ -75,7 +89,7 @@
public int IndexOf(int value)
{
- list.IndexOf(value);
+ return list.IndexOf(value);
}
public void Insert(int index, int value)
@@ -85,7 +99,7 @@
public bool IsSynchronized
{
- get { list.IsSynchronized; }
+ get { return ((IList)list).IsSynchronized; }
}
public void Remove(int value)
@@ -100,7 +114,7 @@
public object SyncRoot
{
- get { return list.SyncRoot; }
+ get { return ((IList)list).SyncRoot; }
}
#endregion Methods
@@ -110,17 +124,17 @@
int IList.Add(object value)
{
- Add((int)value);
+ return Add((int)value);
}
int IList.IndexOf(object value)
{
- IndexOf((int)value);
+ return IndexOf((int)value);
}
bool IList.Contains(object value)
{
- Contains((int)value);
+ return Contains((int)value);
}
void IList.Insert(int index, object value)
@@ -130,12 +144,12 @@
bool IList.IsFixedSize
{
- get { return list.IsFixedSize; }
+ get { return ((IList)list).IsFixedSize; }
}
bool IList.IsReadOnly
{
- get { return list.IsReadOnly; }
+ get { return ((IList)list).IsReadOnly; }
}
@@ -147,7 +161,7 @@
object IList.this[int index]
{
get { return this[index]; }
- set { this[index] = value; }
+ set { this[index] = (int)value; }
}
#endregion
Modified: trunk/bitsharp/src/MonoTorrent/Collections/TrackerCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/TrackerCollection.cs
2007-04-30 21:13:57 UTC (rev 76508)
+++ trunk/bitsharp/src/MonoTorrent/Collections/TrackerCollection.cs
2007-04-30 21:28:53 UTC (rev 76509)
@@ -12,7 +12,7 @@
#region Private Fields
#if NET_2_0
- private List<Tracker> list;
+ private List<MonoTorrent.Client.Tracker> list;
#else
private ArrayList list;
#endif
@@ -24,12 +24,20 @@
public TrackerCollection()
{
+#if NET_2_0
+ list = new List<MonoTorrent.Client.Tracker>();
+#else
list = new ArrayList();
+#endif
}
public TrackerCollection(int capacity)
{
+#if NET_2_0
+ list = new List<MonoTorrent.Client.Tracker>(capacity);
+#else
list = new ArrayList(capacity);
+#endif
}
#endregion
@@ -37,15 +45,20 @@
#region Methods
- public Tracker this[int index]
+ public MonoTorrent.Client.Tracker this[int index]
{
- get { return (Tracker)list[index]; }
+ get { return (MonoTorrent.Client.Tracker)list[index]; }
set { list[index] = value; }
}
- public void Add(Tracker value)
+ public int Add(MonoTorrent.Client.Tracker value)
{
- this.list.Add(value);
+#if NET_2_0
+ list.Add(value);
+ return 0;
+#else
+ return this.list.Add(value);
+#endif
}
public void Clear()
@@ -53,14 +66,14 @@
this.list.Clear();
}
- public bool Contains(Tracker value)
+ public bool Contains(MonoTorrent.Client.Tracker value)
{
return list.Contains(value);
}
public void CopyTo(Array array, int index)
{
- list.CopyTo(array, index);
+ ((IList)list).CopyTo(array, index);
}
public int Count
@@ -73,22 +86,22 @@
return list.GetEnumerator();
}
- public int IndexOf(Tracker value)
+ public int IndexOf(MonoTorrent.Client.Tracker value)
{
- list.IndexOf(value);
+ return list.IndexOf(value);
}
- public void Insert(int index, Tracker value)
+ public void Insert(int index, MonoTorrent.Client.Tracker value)
{
list.Insert(index, value);
}
public bool IsSynchronized
{
- get { list.IsSynchronized; }
+ get { return ((IList)list).IsSynchronized; }
}
- public void Remove(Tracker value)
+ public void Remove(MonoTorrent.Client.Tracker value)
{
list.Remove(value);
}
@@ -100,7 +113,7 @@
public object SyncRoot
{
- get { return list.SyncRoot; }
+ get { return ((IList)list).SyncRoot; }
}
#endregion Methods
@@ -110,46 +123,47 @@
int IList.Add(object value)
{
- Add((int)value);
+ return Add((MonoTorrent.Client.Tracker)value);
}
int IList.IndexOf(object value)
{
- IndexOf((int)value);
+ return IndexOf((MonoTorrent.Client.Tracker)value);
}
bool IList.Contains(object value)
{
- Contains((int)value);
+ return Contains((MonoTorrent.Client.Tracker)value);
}
void IList.Insert(int index, object value)
{
- Insert(index, (int)value);
+ Insert(index, (MonoTorrent.Client.Tracker)value);
}
bool IList.IsFixedSize
{
- get { return list.IsFixedSize; }
+ get { return ((IList)list).IsFixedSize; }
}
bool IList.IsReadOnly
{
- get { return list.IsReadOnly; }
+ get { return ((IList)list).IsReadOnly; }
}
void IList.Remove(object value)
{
- Remove((int)value);
+ Remove((MonoTorrent.Client.Tracker)value);
}
object IList.this[int index]
{
get { return this[index]; }
- set { this[index] = value; }
+ set { this[index] = (MonoTorrent.Client.Tracker)value; }
}
#endregion
}
}
+
Modified: trunk/bitsharp/src/MonoTorrent/Collections/UntypedCollection.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/Collections/UntypedCollection.cs
2007-04-30 21:13:57 UTC (rev 76508)
+++ trunk/bitsharp/src/MonoTorrent/Collections/UntypedCollection.cs
2007-04-30 21:28:53 UTC (rev 76509)
@@ -1,4 +1,5 @@
/*
+
using System;
using System.Text;
using System.Collections;
@@ -25,12 +26,20 @@
public @[EMAIL PROTECTED]()
{
+#if NET_2_0
+ list = new List<@TYPE@>();
+#else
list = new ArrayList();
+#endif
}
public @[EMAIL PROTECTED](int capacity)
{
+#if NET_2_0
+ list = new List<@TYPE@>(capacity);
+#else
list = new ArrayList(capacity);
+#endif
}
#endregion
@@ -44,9 +53,14 @@
set { list[index] = value; }
}
- public void Add(@TYPE@ value)
+ public int Add(@TYPE@ value)
{
- this.list.Add(value);
+#if NET_2_0
+ list.Add(value);
+ return 0;
+#else
+ return this.list.Add(value);
+#endif
}
public void Clear()
@@ -61,7 +75,7 @@
public void CopyTo(Array array, int index)
{
- list.CopyTo(array, index);
+ ((IList)list).CopyTo(array, index);
}
public int Count
@@ -76,7 +90,7 @@
public int IndexOf(@TYPE@ value)
{
- list.IndexOf(value);
+ return list.IndexOf(value);
}
public void Insert(int index, @TYPE@ value)
@@ -86,7 +100,7 @@
public bool IsSynchronized
{
- get { list.IsSynchronized; }
+ get { return ((IList)list).IsSynchronized; }
}
public void Remove(@TYPE@ value)
@@ -101,7 +115,7 @@
public object SyncRoot
{
- get { return list.SyncRoot; }
+ get { return ((IList)list).SyncRoot; }
}
#endregion Methods
@@ -111,48 +125,48 @@
int IList.Add(object value)
{
- Add((int)value);
+ return Add((@TYPE@)value);
}
int IList.IndexOf(object value)
{
- IndexOf((int)value);
+ return IndexOf((@TYPE@)value);
}
bool IList.Contains(object value)
{
- Contains((int)value);
+ return Contains((@TYPE@)value);
}
void IList.Insert(int index, object value)
{
- Insert(index, (int)value);
+ Insert(index, (@TYPE@)value);
}
bool IList.IsFixedSize
{
- get { return list.IsFixedSize; }
+ get { return ((IList)list).IsFixedSize; }
}
bool IList.IsReadOnly
{
- get { return list.IsReadOnly; }
+ get { return ((IList)list).IsReadOnly; }
}
void IList.Remove(object value)
{
- Remove((int)value);
+ Remove((@TYPE@)value);
}
object IList.this[int index]
{
get { return this[index]; }
- set { this[index] = value; }
+ set { this[index] = (@TYPE@)value; }
}
#endregion
}
}
-*/
\ No newline at end of file
+*/
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches