minor CLS conformance tweaks (visibility, virtual, abstract, sealed, etc...)
[mono.git] / mcs / class / System / System.Configuration / SingleTagSectionHandler.cs
index dcaf64c14f5f0f87b76d7902ff353f308ec72180..601ed10d82ab348f26e12ff2858a2f2144d25c93 100644 (file)
@@ -1,42 +1,64 @@
-//\r
-// System.Configuration.SingleTagSectionHandler.cs\r
-//\r
-// Author:\r
-//   Christopher Podurgiel (cpodurgiel@msn.com)\r
-//\r
-// (C) Chris Podurgiel\r
-//\r
-\r
-using System;\r
-using System.Xml;\r
-\r
-\r
-namespace System.Configuration\r
-{\r
-       /// <summary>\r
-       /// Summary description for SingleTagSectionHandler.\r
-       /// </summary>\r
-       public class SingleTagSectionHandler : IConfigurationSectionHandler\r
-       {\r
-\r
-               public SingleTagSectionHandler()\r
-               {\r
-                       //\r
-                       // TODO: Add constructor logic here\r
-                       //\r
-               }\r
-\r
-               /// <summary>\r
-               ///             Returns a collection of configuration section values.\r
-               /// </summary>\r
-               /// <param name="parent"></param>\r
-               /// <param name="context"></param>\r
-               /// <param name="section">The name of the configuration section.</param>\r
-               /// <returns></returns>\r
-               public object Create(object parent, object context, XmlNode section)\r
-               {\r
-                       //FIXME: Add Implemetation code here.\r
-                       return null;\r
-               }\r
-       }\r
-}\r
+//
+// System.Configuration.SingleTagSectionHandler.cs
+//
+// Author:
+//   Christopher Podurgiel (cpodurgiel@msn.com)
+//
+// (C) Chris Podurgiel
+//
+
+using System;
+using System.Xml;
+using System.Collections;
+
+
+namespace System.Configuration
+{
+       /// <summary>
+       /// Summary description for SingleTagSectionHandler.
+       /// </summary>
+       public class SingleTagSectionHandler : IConfigurationSectionHandler
+       {
+
+               [MonoTODO]
+               public SingleTagSectionHandler()
+               {
+                       //
+                       // TODO: Add constructor logic here
+                       //
+               }
+
+               /// <summary>
+               ///             Returns a collection of configuration section values.
+               /// </summary>
+               /// <param name="parent"></param>
+               /// <param name="context"></param>
+               /// <param name="section">The name of the configuration section.</param>
+               /// <returns></returns>
+               [MonoTODO]
+               public virtual object Create(object parent, object context, XmlNode section)
+               {
+                       //FIXME: I'm not quite sure how to implement 'parent' or 'context'.
+                       //TODO: Add in proper Error Handling.
+
+                       //Get all of the ChildNodes in the XML section.
+                       if(section.HasChildNodes)
+                       {
+                               throw (new ConfigurationException("Child Nodes not allowed."));
+                       }
+                       
+                       
+                       //Get the attributes for the childNode
+                       XmlAttributeCollection xmlAttributes = section.Attributes;
+
+                       Hashtable settingsCollection = new Hashtable();
+                       
+                       for(int i=0; i < xmlAttributes.Count; i++)
+                       {
+                               settingsCollection.Add(xmlAttributes[i].Name, xmlAttributes[i].Value);
+                       }
+                       
+                       return settingsCollection;
+               }
+       }
+}