[Mono-list] patch for Hashtable ctr neccesary for custom Serialization support

Cesar Octavio López Nataren cesar@ciencias.unam.mx
Thu, 08 Aug 2002 22:48:49 -0500


This is a MIME-formatted message.  If you see this text it means that your
mail software cannot handle MIME-formatted messages.

--=_0_44359_1028864929
Content-Type: text/plain; format=flowed; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

Hello!
I wrote this little constructor for the serialization support.
Can someone review it?, please.
I'd like to receive some feedback. 

Thanks in advance.
Best regards mono:: team. 


Cesar
--=_0_44359_1028864929
Content-Disposition: attachment; filename="Hashtable.diff"
Content-Type: text/plain; charset="iso-8859-1"; name="Hashtable.diff"
Content-Transfer-Encoding: 7bit

Index: Hashtable.cs
===================================================================
RCS file: /mono/mcs/class/corlib/System.Collections/Hashtable.cs,v
retrieving revision 1.14
diff -u -r1.14 Hashtable.cs
--- Hashtable.cs	28 Apr 2002 19:42:42 -0000	1.14
+++ Hashtable.cs	9 Aug 2002 03:43:04 -0000
@@ -181,15 +181,15 @@
 		{
 		}
 
-		[MonoTODO]
 		protected Hashtable (SerializationInfo info, StreamingContext context)
-		{
-//			loadFactor = info.GetValue ("LoadFactor", Type.GetType ("System.Float"));
-//			comparerRef = info.GetValue ("Comparer", typeof (object));
-//			hcpRef = info.GetValue ("HashCodeProvider", typeof (object));
-//			this.Count = info.GetValue ("HashSize");
-// 			this.Keys = info.GetValue ("Keys");
-// 			this.Values = info.GetValue ("Values");
+		{			
+			loadFactor = info.GetSingle ("LoadFactor");			
+			this.modificationCount = info.GetInt32 ("Version");
+			comparerRef = info.GetValue ("Comparer", typeof (IComparer));
+			hcpRef = info.GetValue ("HashCodeProvider", typeof (IHashCodeProvider));
+			this.Count = info.GetInt32 ("HashSize"); 			
+ 			this.Keys = info.GetValue ("Keys", typeof (ICollection));
+ 			this.Values = info.GetValue ("Values", typeof (ICollection));
  		}
 
 		//
@@ -407,7 +407,6 @@
 			return ht;
 		}
 
-		[MonoTODO]
 		public virtual void GetObjectData (SerializationInfo info, StreamingContext context)
 		{
 			info.AddValue ("LoadFactor", loadFactor);
@@ -420,10 +419,10 @@
 		}
 
 		[MonoTODO]
-		public virtual void OnDeserialization (object sender)
-		{
-			throw new NotImplementedException ();
-		}
+		public virtual void OnDeserialization (object sender)
+		{
+			throw new NotImplementedException ();
+		}
 
 		/// <summary>
 		///  Returns a synchronized (thread-safe)

--=_0_44359_1028864929--