Merge pull request #303 from ermshiperete/5278
[mono.git] / mcs / class / System / System.Configuration / SettingElementCollection.cs
index 725158ac7a90d875fdabdc7351a081a4e2bf4e5e..c6789e9183de0a9ca1362403f555f4806b105fde 100644 (file)
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+#if CONFIGURATION_DEP
 using System;
 
 namespace System.Configuration
 {
        public sealed class SettingElementCollection
-#if (CONFIGURATION_DEP)
                : ConfigurationElementCollection
-#endif
        {
                public SettingElementCollection ()
                {
                }
 
-               [MonoTODO]
                public void Add (SettingElement element)
                {
-                       throw new NotImplementedException ();
+                       BaseAdd (element);
                }
 
-               [MonoTODO]
                public void Clear ()
                {
-                       throw new NotImplementedException ();
+                       BaseClear ();
                }
 
-               [MonoTODO]
                public SettingElement Get (string elementKey)
                {
-                       throw new NotImplementedException ();
+                       foreach (SettingElement el in this)
+                               if (el.Name == elementKey)
+                                       return el;
+                       return null;
                }
 
-               [MonoTODO]
                public void Remove (SettingElement element)
                {
-                       throw new NotImplementedException ();
+                       if (element == null)
+                               throw new ArgumentNullException ("element");
+                       BaseRemove (element.Name);
                }
 
-#if (CONFIGURATION_DEP)
                protected override ConfigurationElement CreateNewElement ()
                {
                        return new SettingElement ();
@@ -82,7 +80,6 @@ namespace System.Configuration
                protected override string ElementName {
                        get { return "setting"; }
                }
-#endif
        }
 
 }