Index: class/corlib/System.Collections/SortedList.cs
===================================================================
RCS file: /mono/mcs/class/corlib/System.Collections/SortedList.cs,v
retrieving revision 1.11
diff -u -r1.11 SortedList.cs
--- class/corlib/System.Collections/SortedList.cs	9 Jun 2003 00:41:38 -0000	1.11
+++ class/corlib/System.Collections/SortedList.cs	12 Jun 2003 20:27:42 -0000
@@ -3,6 +3,7 @@
 // 
 // Author:
 //   Sergey Chaban (serge@wildwestsoftware.com)
+//   Herve Poussineau (hpoussineau@fr.st)
 // 
 
 
@@ -29,7 +30,7 @@
 
 		private readonly static int INITIAL_SIZE = 16;
 
-		public enum EnumeratorMode : int {KEY_MODE = 0, VALUE_MODE}
+		public enum EnumeratorMode : int {KEY_MODE = 0, VALUE_MODE, ENTRY_MODE}
 
 		private int inUse;
 		private int modificationCount;
@@ -219,7 +220,7 @@
 
 		public virtual IDictionaryEnumerator GetEnumerator ()
 		{
-			return new Enumerator (this, EnumeratorMode.KEY_MODE);
+			return new Enumerator (this, EnumeratorMode.ENTRY_MODE);
 		}
 
 		public virtual void Remove (object key)
@@ -591,7 +592,7 @@
 			}
 
 			public Enumerator (SortedList host)
-			: this (host, EnumeratorMode.KEY_MODE)
+			: this (host, EnumeratorMode.ENTRY_MODE)
 			{
 			}
 
@@ -657,9 +658,17 @@
 					if (invalid || pos >= size || pos == -1)
 						throw new InvalidOperationException (xstr);
 					
-					return (mode == EnumeratorMode.KEY_MODE)
-					        ? currentKey
-					        : currentValue;
+					switch (mode)
+					{
+						case EnumeratorMode.KEY_MODE:
+							return currentKey;
+						case EnumeratorMode.VALUE_MODE:
+							return currentValue;
+						case EnumeratorMode.ENTRY_MODE:
+							return this.Entry;
+					}
+					// Should never happen
+					throw new NotSupportedException("Not supported mode == " + mode);
 				}
 			}
 		}
