2005-04-22 LLuis Sanchez Gual <lluis@novell.com>
[mono.git] / mcs / class / System / System.ComponentModel / AttributeCollection.cs
index 2c5c6d840e0f66f8eba4915e9ab4ae9992b9570b..658117ac1af0982a8042209ee40985fa39bad2e7 100644 (file)
@@ -56,7 +56,11 @@ namespace System.ComponentModel
 
                public bool Contains (Attribute attr)
                {
-                       return attrList.Contains (attr);
+                       Attribute at = this [attr.GetType ()];
+                       if (at != null)
+                               return attr.Equals (at);
+                       else
+                               return false;
                }
 
                public bool Contains (Attribute [] attributes)
@@ -138,7 +142,7 @@ namespace System.ComponentModel
                        get {
                                Attribute attr = null;
                                foreach (Attribute a in attrList) {
-                                       if (a.GetType () == type){
+                                       if (type.IsAssignableFrom (a.GetType ())) {
                                                attr = a;
                                                break;
                                        }