minor CLS conformance tweaks (visibility, virtual, abstract, sealed, etc...)
[mono.git] / mcs / class / System / System.Configuration / SingleTagSectionHandler.cs
1 //
2 // System.Configuration.SingleTagSectionHandler.cs
3 //
4 // Author:
5 //   Christopher Podurgiel (cpodurgiel@msn.com)
6 //
7 // (C) Chris Podurgiel
8 //
9
10 using System;
11 using System.Xml;
12 using System.Collections;
13
14
15 namespace System.Configuration
16 {
17         /// <summary>
18         /// Summary description for SingleTagSectionHandler.
19         /// </summary>
20         public class SingleTagSectionHandler : IConfigurationSectionHandler
21         {
22
23                 [MonoTODO]
24                 public SingleTagSectionHandler()
25                 {
26                         //
27                         // TODO: Add constructor logic here
28                         //
29                 }
30
31                 /// <summary>
32                 ///             Returns a collection of configuration section values.
33                 /// </summary>
34                 /// <param name="parent"></param>
35                 /// <param name="context"></param>
36                 /// <param name="section">The name of the configuration section.</param>
37                 /// <returns></returns>
38                 [MonoTODO]
39                 public virtual object Create(object parent, object context, XmlNode section)
40                 {
41                         //FIXME: I'm not quite sure how to implement 'parent' or 'context'.
42                         //TODO: Add in proper Error Handling.
43
44                         //Get all of the ChildNodes in the XML section.
45                         if(section.HasChildNodes)
46                         {
47                                 throw (new ConfigurationException("Child Nodes not allowed."));
48                         }
49                         
50                         
51                         //Get the attributes for the childNode
52                         XmlAttributeCollection xmlAttributes = section.Attributes;
53
54                         Hashtable settingsCollection = new Hashtable();
55                         
56                         for(int i=0; i < xmlAttributes.Count; i++)
57                         {
58                                 settingsCollection.Add(xmlAttributes[i].Name, xmlAttributes[i].Value);
59                         }
60                         
61                         return settingsCollection;
62                 }
63         }
64 }