diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2003-10-21 20:06:02 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2003-10-21 20:06:02 +0400 |
commit | c3db274ddea0f2e28d381a73ff40bde0367b9e3c (patch) | |
tree | 328d95a493b7ba110c43295f9df4df37a098e906 /mcs/class/System/System.Collections.Specialized | |
parent | be9dcf6a086ace64b65d4d16e6a023b2a7fd06ad (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.cs | 17 |
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)); |