Skip to content

Commit

Permalink
2005-12-19 Sebastien Pouliot <sebastien@ximian.com>
Browse files Browse the repository at this point in the history
	* Dictionary.cs: Added [Serializable] attribute to both inner 
	Enumerator struct in Key and Value inner collection classes.
	* EqualityComparer.cs: Added missing IEqualityComparer interface.
	* List.cs: Added [Serializable] attribute to both inner Enumerator
	struct.


svn path=/trunk/mcs/; revision=54619
  • Loading branch information
Sebastien Pouliot committed Dec 19, 2005
1 parent d588ea3 commit b4a30d2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
8 changes: 8 additions & 0 deletions mcs/class/corlib/System.Collections.Generic/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2005-12-19 Sebastien Pouliot <sebastien@ximian.com>

* Dictionary.cs: Added [Serializable] attribute to both inner
Enumerator struct in Key and Value inner collection classes.
* EqualityComparer.cs: Added missing IEqualityComparer interface.
* List.cs: Added [Serializable] attribute to both inner Enumerator
struct.

2005-12-19 Sebastien Pouliot <sebastien@ximian.com>

* Dictionary.cs: Fixed ICollection.CopyTo to use DictionaryEntry. Fixed
Expand Down
2 changes: 2 additions & 0 deletions mcs/class/corlib/System.Collections.Generic/Dictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,7 @@ object ICollection.SyncRoot {
get { return ((ICollection) dictionary).SyncRoot; }
}

[Serializable]
public struct Enumerator : IEnumerator<TKey>, IDisposable, IEnumerator {
Dictionary<TKey, TValue>.Enumerator host_enumerator;

Expand Down Expand Up @@ -771,6 +772,7 @@ object ICollection.SyncRoot {
get { return ((ICollection) dictionary).SyncRoot; }
}

[Serializable]
public struct Enumerator : IEnumerator<TValue>, IDisposable, IEnumerator {
Dictionary<TKey, TValue>.Enumerator host_enumerator;

Expand Down
12 changes: 11 additions & 1 deletion mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

namespace System.Collections.Generic {
[Serializable]
public abstract class EqualityComparer <T> : IEqualityComparer <T> {
public abstract class EqualityComparer <T> : IEqualityComparer, IEqualityComparer <T> {

static EqualityComparer ()
{
Expand All @@ -53,6 +53,16 @@ public static EqualityComparer <T> Default {
return _default;
}
}

int IEqualityComparer.GetHashCode (object obj)
{
return GetHashCode ((T)obj);
}

bool IEqualityComparer.Equals (object x, object y)
{
return Equals ((T)x, (T)y);
}

[Serializable]
class DefaultComparer : EqualityComparer<T> {
Expand Down
1 change: 1 addition & 0 deletions mcs/class/corlib/System.Collections.Generic/List.cs
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ object IList.this [int index] {
}
#endregion

[Serializable]
public struct Enumerator : IEnumerator <T>, IDisposable {
const int NOT_STARTED = -2;

Expand Down

0 comments on commit b4a30d2

Please sign in to comment.