Author: roeie
Date: 2007-05-27 09:22:15 -0400 (Sun, 27 May 2007)
New Revision: 78008
Modified:
trunk/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
trunk/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
Log:
Fix .NET 1.1 compatability
Modified:
trunk/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
===================================================================
---
trunk/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
2007-05-27 13:02:10 UTC (rev 78007)
+++
trunk/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
2007-05-27 13:22:15 UTC (rev 78008)
@@ -209,8 +209,10 @@
#endif
m_defCapacity = capacity;
Init();
- }
+ }
+#if NET_2_0
+
internal NameObjectCollectionBase (IEqualityComparer
equalityComparer, IComparer comparer, IHashCodeProvider hcp)
{
equality_comparer = equalityComparer;
@@ -221,15 +223,19 @@
Init ();
}
-#if NET_2_0
protected NameObjectCollectionBase (IEqualityComparer
equalityComparer) : this( (equalityComparer == null ?
StringComparer.InvariantCultureIgnoreCase : equalityComparer), null, null)
{
}
[Obsolete ("Use NameObjectCollectionBase(IEqualityComparer)")]
#endif
- protected NameObjectCollectionBase( IHashCodeProvider
hashProvider, IComparer comparer ) : this(null, comparer, hashProvider)
+ protected NameObjectCollectionBase( IHashCodeProvider
hashProvider, IComparer comparer )
{
+ m_comparer = comparer;
+ m_hashprovider = hashProvider;
+ m_readonly = false;
+ m_defCapacity = 0;
+ Init ();
}
protected NameObjectCollectionBase (SerializationInfo info,
StreamingContext context)
Modified:
trunk/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
===================================================================
---
trunk/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
2007-05-27 13:02:10 UTC (rev 78007)
+++
trunk/mcs/class/System/System.Collections.Specialized/NameValueCollection.cs
2007-05-27 13:22:15 UTC (rev 78008)
@@ -49,19 +49,24 @@
public NameValueCollection (int capacity) : base (capacity)
{
}
-
- public NameValueCollection (NameValueCollection col) : base ((
col == null ) ? null : col.EqualityComparer ,
-
(col == null) ? null :
col.Comparer,
-
(col == null) ? null :
col.HashCodeProvider)
+#if NET_2_0
+ public NameValueCollection (NameValueCollection col) : base (( col ==
null ) ? null : col.EqualityComparer ,
+ (col == null)
? null : col.Comparer,
+ (col == null)
? null : col.HashCodeProvider)
+ {
+ if (col==null)
+ throw new ArgumentNullException ("col");
+ Add(col);
+ }
+#else
+ public NameValueCollection (NameValueCollection col) : base
((col == null) ? null : col.HashCodeProvider ,
+
(col == null) ? null :
col.Comparer)
{
if (col==null)
-#if NET_2_0
- throw new ArgumentNullException ("col");
-#else
- throw new NullReferenceException ();
-#endif
+ throw new NullReferenceException ();
Add(col);
}
+#endif
#if NET_2_0
[Obsolete ("Use NameValueCollection (IEqualityComparer)")]
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches