Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2003-10-21 20:06:02 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2003-10-21 20:06:02 +0400
commitc3db274ddea0f2e28d381a73ff40bde0367b9e3c (patch)
tree328d95a493b7ba110c43295f9df4df37a098e906 /mcs/class/System/System.Collections.Specialized
parentbe9dcf6a086ace64b65d4d16e6a023b2a7fd06ad (diff)
fix deserialization. thanks to lluis.
svn path=/trunk/mcs/; revision=19274
Diffstat (limited to 'mcs/class/System/System.Collections.Specialized')
-rw-r--r--mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs17
1 files changed, 9 insertions, 8 deletions
diff --git a/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs b/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
index dbb2b307eac..d29cc29ea34 100644
--- a/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
+++ b/mcs/class/System/System.Collections.Specialized/NameObjectCollectionBase.cs
@@ -27,6 +27,7 @@ namespace System.Collections.Specialized
private IComparer m_comparer;
private int m_defCapacity;
private bool m_readonly;
+ SerializationInfo infoCopy;
internal IComparer Comparer {
get {return m_comparer;}
@@ -199,10 +200,12 @@ namespace System.Collections.Specialized
m_NullKeyItem = null; */
//throw new Exception("Not implemented yet");
}
- protected NameObjectCollectionBase( SerializationInfo info, StreamingContext context )
- {
- throw new Exception("Not implemented yet");
- }
+
+ protected NameObjectCollectionBase (SerializationInfo info, StreamingContext context)
+ {
+ infoCopy = info;
+ }
+
protected NameObjectCollectionBase( int capacity, IHashCodeProvider hashProvider, IComparer comparer )
{
m_readonly = false;
@@ -296,13 +299,11 @@ namespace System.Collections.Specialized
// IDeserializationCallback
public virtual void OnDeserialization (object sender)
{
- if (sender == null)
- throw new ArgumentNullException ("sender");
-
- SerializationInfo info = sender as SerializationInfo;
+ SerializationInfo info = infoCopy;
if (info == null)
throw new SerializationException ("The object is not a SerializationInfo");
+ infoCopy = null;
m_hashprovider = (IHashCodeProvider) info.GetValue ("m_hashprovider",
typeof (IHashCodeProvider));