Commit
[mono.git] / mcs / class / System / System.ComponentModel / AttributeCollection.cs
index ed36edd9fea6a3745ce4fd2e3dd7296aeef4543a..8e11797c9eb8d8d8810b006d6851727ecb7574bb 100644 (file)
@@ -47,13 +47,30 @@ namespace System.ComponentModel
                        attrList = attributes;
                }
                
+#if NET_2_0
+               public AttributeCollection (params Attribute[] attributes)
+#else
                public AttributeCollection (Attribute[] attributes)
+#endif
                {
                        if (attributes != null)
                                for (int i = 0; i < attributes.Length; i++)
                                        attrList.Add (attributes[i]);
                }
 
+#if NET_2_0
+               public static AttributeCollection FromExisting (AttributeCollection existing, params Attribute [] newAttributes)
+               {
+                       if (existing == null)
+                               throw new ArgumentNullException ("existing");
+                       AttributeCollection ret = new AttributeCollection ();
+                       ret.attrList.AddRange (existing.attrList);
+                       if (newAttributes != null)
+                               ret.attrList.AddRange (newAttributes);
+                       return ret;
+               }
+#endif
+
                public bool Contains (Attribute attr)
                {
                        Attribute at = this [attr.GetType ()];