New tests.
[mono.git] / mcs / class / corlib / System.Runtime.Serialization / SerializationInfo.cs
index 3d04c4fef5a6f6ccd849e191dcf7b4b3c8f9d2c4..2e92f1c7ca75504b839cd92f82164127a2a2cf01 100644 (file)
@@ -38,6 +38,7 @@ using System.Collections;
 
 namespace System.Runtime.Serialization
 {
+       [System.Runtime.InteropServices.ComVisibleAttribute (true)]
        public sealed class SerializationInfo
        {
                Hashtable serialized = new Hashtable ();
@@ -142,12 +143,17 @@ namespace System.Runtime.Serialization
                                                
                        SerializationEntry entry = (SerializationEntry) serialized [name];
 
-                       if (entry.Value != null && !type.IsAssignableFrom (entry.Value.GetType()))
+                       if (entry.Value != null && !type.IsInstanceOfType (entry.Value))
                                return converter.Convert (entry.Value, type);
                        else
                                return entry.Value;
                }
 
+               internal bool HasKey (string name)
+               {
+                       return serialized [name] != null;
+               }
+               
                public void SetType (Type type)
                {
                        if (type == null)
@@ -339,6 +345,7 @@ namespace System.Runtime.Serialization
                }
 
                /* used by the runtime */
+#pragma warning disable 169            
                private SerializationEntry [] get_entries ()
                {
                        SerializationEntry [] res = new SerializationEntry [this.MemberCount];
@@ -349,5 +356,6 @@ namespace System.Runtime.Serialization
                        
                        return res;
                }
+#pragma warning restore 169            
        }
 }