2009-06-05 Marek Habersack <mhabersack@novell.com>
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / TagPrefixCollection.cs
index 2ae26042ddba57793206538ad569d83f241004ec..c83920f8a5c14fb46a7541db57334dcd0f8c20e2 100644 (file)
@@ -36,8 +36,8 @@ using System.Configuration;
 
 namespace System.Web.Configuration
 {
-       [ConfigurationCollection (typeof (TagPrefixInfo))]
-       public sealed class TagPrefixCollection : ConfigurationElementCollection, ICollection, IEnumerable
+       [ConfigurationCollection (typeof (TagPrefixInfo), CollectionType = ConfigurationElementCollectionType.BasicMap)]
+       public sealed class TagPrefixCollection : ConfigurationElementCollection
        {
                static ConfigurationPropertyCollection properties;
 
@@ -62,32 +62,28 @@ namespace System.Web.Configuration
 
                protected override ConfigurationElement CreateNewElement ()
                {
-                       return new TagPrefixInfo ("", "", "", "", "");
+                       return new TagPrefixInfo ();
                }
 
-               [MonoTODO]
                protected override object GetElementKey (ConfigurationElement element)
                {
-                       return ((TagPrefixInfo)element).TagPrefix;
+                       TagPrefixInfo info = (TagPrefixInfo)element;
+                       return String.Concat (info.TagPrefix, "-", info.TagName, "-", info.Source, "-", info.Namespace, "-", info.Assembly);
                }
 
                public void Remove (TagPrefixInfo tagPrefixInformation)
                {
-                       BaseRemove (tagPrefixInformation.TagPrefix);
+                       BaseRemove (GetElementKey (tagPrefixInformation));
                }
 
-               [MonoTODO]
-               protected override ConfigurationElementCollectionType CollectionType {
-                       get {
-                               return ConfigurationElementCollectionType.BasicMap;
-                       }
+               [MonoTODO ("why override this?")]
+               public override ConfigurationElementCollectionType CollectionType {
+                       get { return ConfigurationElementCollectionType.BasicMap; }
                }
 
-               [MonoTODO]
+               [MonoTODO ("why override this?")]
                protected override string ElementName {
-                       get {
-                               throw new NotImplementedException ();
-                       }
+                       get { return "add"; }
                }
 
                protected override ConfigurationPropertyCollection Properties {