Merge pull request #4540 from kumpera/android-changes-part1
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / ProfileSettingsCollection.cs
index 108e7c30d29f43727d5efd357b527bf730f5ca03..d3dffccb01d67c086430ddf0cba2b8c561987fb7 100644 (file)
@@ -31,7 +31,6 @@
 using System;
 using System.Configuration;
 
-#if NET_2_0
 
 namespace System.Web.Configuration {
 
@@ -55,15 +54,14 @@ namespace System.Web.Configuration {
                        BaseClear ();
                }
 
-               [MonoTODO]
                public bool Contains (string name)
                {
-                       throw new NotImplementedException ();
+                       return BaseGet (name) != null;
                }
 
                protected override ConfigurationElement CreateNewElement ()
                {
-                       return new ProfileSettings ("");
+                       return new ProfileSettings ();
                }
 
                protected override object GetElementKey (ConfigurationElement element)
@@ -71,16 +69,19 @@ namespace System.Web.Configuration {
                        return ((ProfileSettings)element).Name;
                }
 
-               [MonoTODO]
                public int IndexOf (string name)
                {
-                       throw new NotImplementedException ();
+                       ProfileSettings s = (ProfileSettings)BaseGet (name);
+                       if (s == null)
+                               return -1; /* XXX */
+                       else
+                               return BaseIndexOf (s);
                }
 
-               [MonoTODO]
+               [MonoTODO ("why did they use 'Insert' and not 'Add' as other collections do?")]
                public void Insert (int index, ProfileSettings authorizationSettings)
                {
-                       throw new NotImplementedException ();
+                       BaseAdd (index, authorizationSettings);
                }
 
                public void Remove (string name)
@@ -93,8 +94,8 @@ namespace System.Web.Configuration {
                        BaseRemoveAt (index);
                }
 
-               public new ProfileSettings this [string name] {
-                       get { return (ProfileSettings)BaseGet (name); }
+               public new ProfileSettings this [string key] {
+                       get { return (ProfileSettings)BaseGet (key); }
                }
 
                public ProfileSettings this [int index] {
@@ -102,7 +103,7 @@ namespace System.Web.Configuration {
                        set { if (BaseGet (index) != null) BaseRemoveAt (index); BaseAdd (index, value); }
                }
 
-               protected override ConfigurationPropertyCollection Properties {
+               protected internal override ConfigurationPropertyCollection Properties {
                        get { return properties; }
                }
 
@@ -110,5 +111,4 @@ namespace System.Web.Configuration {
 
 }
 
-#endif