2001-08-24 Christopher Podurgiel <cpodurgiel@msn.com>
authorChristopher Podurgiel <cpodu@mono-cvs.ximian.com>
Fri, 24 Aug 2001 08:10:04 +0000 (08:10 -0000)
committerChristopher Podurgiel <cpodu@mono-cvs.ximian.com>
Fri, 24 Aug 2001 08:10:04 +0000 (08:10 -0000)
* SingleTagSectionHandler.cs: Added.
* DictionarySectionHandler.cs: Added.

* NameValueSectionHandler.cs: Compile errors are now fixed.
* IgnoreSectionHandler.cs: Compile errors are now fixed.

* ConfigurationSettings.cs: Added Implementation code for the entire class.
  Note the LAMESPEC: in GetConfig().

svn path=/trunk/mcs/; revision=601

mcs/class/System/System.Configuration/ConfigurationException.cs
mcs/class/System/System.Configuration/ConfigurationSettings.cs
mcs/class/System/System.Configuration/DictionarySectionHandler.cs [new file with mode: 0644]
mcs/class/System/System.Configuration/IConfigurationSectionHandler.cs
mcs/class/System/System.Configuration/IgnoreSectionHandler.cs
mcs/class/System/System.Configuration/NameValueSectionHandler.cs
mcs/class/System/System.Configuration/SingleTagSectionHandler.cs [new file with mode: 0644]
mcs/class/System/System.Configuration/common.src

index 356410405a0712792e67df8d64e959ed2b5b2289..59e183a3c4efa2f17a4fac0823322f6256e2a4c6 100644 (file)
-//
-// System.Configuration.ConfigurationException.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-using System;
-using System.Xml;
-
-namespace System.Configuration
-{
-
-       /// <summary>
-       ///             ConfigurationException class.
-       /// </summary>
-       /// <remarks>
-       ///   Longer description
-       /// </remarks>
-       public class ConfigurationException : SystemException
-       {
-
-               private static string _stringBareMessage;
-               private static string _stringFilename;
-               private static int _intLine;
-               private static string _stringMessage;
-
-               /// <summary>
-               ///             ConfigurationException Constructor.
-               /// </summary>
-               public ConfigurationException ()
-               {
-                       _stringBareMessage = null;
-                       _stringFilename = null;
-                       _intLine = 0;
-                       _stringMessage = null;
-               }
-
-               /// <summary>
-               ///             ConfigurationException Constructor.
-               /// </summary>
-               public ConfigurationException (string message)
-               {
-                       _stringBareMessage = message;
-                       _stringFilename = null;
-                       _intLine = 0;
-                       _stringMessage = null;
-               }
-
-               /// <summary>
-               ///             ConfigurationException Constructor.
-               /// </summary>
-               public ConfigurationException (string message, Exception inner)
-               {
-                       _stringBareMessage = message + " " + inner.ToString();
-                       _stringFilename = null;
-                       _intLine = 0;
-                       _stringMessage = null;
-               }
-
-               /// <summary>
-               ///             ConfigurationException Constructor.
-               /// </summary>
-               public ConfigurationException (string message, XmlNode node)
-               {
-                       _stringBareMessage = message;
-                       _stringFilename = GetXmlNodeFilename(node);
-                       _intLine = GetXmlNodeLineNumber(node);
-                       _stringMessage = _stringFilename + " " + _intLine;
-               }
-
-               /// <summary>
-               ///             ConfigurationException Constructor.
-               /// </summary>
-               public ConfigurationException (string message, Exception inner, XmlNode node)
-               {
-                       _stringBareMessage = message + " " + inner.ToString();
-                       _stringFilename = GetXmlNodeFilename(node);
-                       _intLine = GetXmlNodeLineNumber(node);
-                       _stringMessage = _stringFilename + " " + _intLine;
-               }
-
-               /// <summary>
-               ///             ConfigurationException Constructor.
-               /// </summary>
-               public ConfigurationException (string message, string filename, int line)
-               {
-                       _stringBareMessage = message;
-                       _stringFilename = filename;
-                       _intLine = line;
-                       _stringMessage = _stringFilename + " " + _intLine;
-               }
-
-               /// <summary>
-               ///             ConfigurationException Constructor.
-               /// </summary>
-               public ConfigurationException (string message, Exception inner, string filename, int line)
-               {
-                       _stringBareMessage = message + " " + inner.ToString();
-                       _stringFilename = filename;
-                       _intLine = line;
-                       _stringMessage = _stringFilename + " " + _intLine;
-               }
-
-
-
-               /// <summary>
-               ///             Returns the name of the file containing the configuration section node.
-               /// </summary>
-               /// <param name="node"></param>
-               /// <returns></returns>
-               public static string GetXmlNodeFilename(XmlNode node)
-               {
-                       _stringFilename = node.OwnerDocument.Name;
-                       return _stringFilename;
-               }
-
-               /// <summary>
-               ///             Returns the line number containing the configuration section node.
-               /// </summary>
-               /// <param name="node"></param>
-               /// <returns></returns>
-               public static int GetXmlNodeLineNumber(XmlNode node)
-               {
-
-                       //FIXME: not sure how this should work.
-                       return 0;
-               }
-
-
-               /// <summary>
-               ///             Gets the base error message.
-               /// </summary>
-               public string BareMessage
-               {
-                       get
-                       {
-                               return _stringBareMessage;
-                       }
-               }
-
-               /// <summary>
-               ///             Gets the name of the configuration file where the error occurred.
-               /// </summary>
-               public string Filename
-               {
-                       get
-                       {
-                               return _stringFilename;
-                       }
-               }
-
-               /// <summary>
-               ///             Returns the line number where the error occurred.
-               /// </summary>
-               public int Line
-               {
-                       get
-                       {
-                               return _intLine;
-                       }
-               }
-
-               /// <summary>
-               ///             Gets a string containing the concatenated file name and line number where the error occurred.
-               /// </summary>
-               public override string Message
-               {
-                       get
-                       {
-                               return _stringMessage;
-                       }
-               }
-       }
-}
-
-
+//\r
+// System.Configuration.ConfigurationException.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
+namespace System.Configuration \r
+{\r
+\r
+       /// <summary>\r
+       ///             ConfigurationException class.\r
+       /// </summary>\r
+       /// <remarks>\r
+       ///   Longer description\r
+       /// </remarks>\r
+       public class ConfigurationException : SystemException\r
+       {\r
+       \r
+               private static string   _stringBareMessage;\r
+               private static string   _stringFilename;\r
+               private static int              _intLine;\r
+               private static string   _stringMessage;\r
+\r
+               /// <summary>\r
+               ///             ConfigurationException Constructor.\r
+               /// </summary>\r
+               public ConfigurationException ()\r
+               {\r
+                       _stringBareMessage = null;\r
+                       _stringFilename = null;\r
+                       _intLine = 0;\r
+                       _stringMessage = null;  \r
+               }\r
+               \r
+               /// <summary>\r
+               ///             ConfigurationException Constructor.\r
+               /// </summary>\r
+               public ConfigurationException (string message)\r
+               {\r
+                       _stringBareMessage = message;\r
+                       _stringFilename = null;\r
+                       _intLine = 0;\r
+                       _stringMessage = null;\r
+               }\r
+\r
+               /// <summary>\r
+               ///             ConfigurationException Constructor.\r
+               /// </summary>\r
+               public ConfigurationException (string message, Exception inner)\r
+               {\r
+                       _stringBareMessage = message + " " + inner.ToString();\r
+                       _stringFilename = null;\r
+                       _intLine = 0;\r
+                       _stringMessage = null; \r
+               }\r
+\r
+               /// <summary>\r
+               ///             ConfigurationException Constructor.\r
+               /// </summary>\r
+               public ConfigurationException (string message, XmlNode node)\r
+               {\r
+                       _stringBareMessage = message;\r
+                       _stringFilename = GetXmlNodeFilename(node);\r
+                       _intLine = GetXmlNodeLineNumber(node);\r
+                       _stringMessage = _stringFilename + " " + _intLine;\r
+               }\r
+\r
+               /// <summary>\r
+               ///             ConfigurationException Constructor.\r
+               /// </summary>\r
+               public ConfigurationException (string message, Exception inner, XmlNode node)\r
+               {\r
+                       _stringBareMessage = message + " " + inner.ToString();\r
+                       _stringFilename = GetXmlNodeFilename(node);\r
+                       _intLine = GetXmlNodeLineNumber(node);\r
+                       _stringMessage = _stringFilename + " " + _intLine;\r
+               }\r
+\r
+               /// <summary>\r
+               ///             ConfigurationException Constructor.\r
+               /// </summary>\r
+               public ConfigurationException (string message, string filename, int line)\r
+               {\r
+                       _stringBareMessage = message;\r
+                       _stringFilename = filename;\r
+                       _intLine = line;\r
+                       _stringMessage = _stringFilename + " " + _intLine;\r
+               }\r
+\r
+               /// <summary>\r
+               ///             ConfigurationException Constructor.\r
+               /// </summary>\r
+               public ConfigurationException (string message, Exception inner, string filename, int line)\r
+               {\r
+                       _stringBareMessage = message + " " + inner.ToString();\r
+                       _stringFilename = filename;\r
+                       _intLine = line;\r
+                       _stringMessage = _stringFilename + " " + _intLine;\r
+               }\r
+\r
+\r
+               \r
+               /// <summary>\r
+               ///             Returns the name of the file containing the configuration section node.\r
+               /// </summary>\r
+               /// <param name="node"></param>\r
+               /// <returns></returns>\r
+               public static string GetXmlNodeFilename(XmlNode node)\r
+               {\r
+                       _stringFilename = node.OwnerDocument.Name;\r
+                       return _stringFilename;\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Returns the line number containing the configuration section node.\r
+               /// </summary>\r
+               /// <param name="node"></param>\r
+               /// <returns></returns>\r
+               public static int GetXmlNodeLineNumber(XmlNode node)\r
+               {\r
+                       \r
+                       //FIXME: not sure how this should work.\r
+                       return 0;\r
+               }\r
+\r
+\r
+               /// <summary>\r
+               ///             Gets the base error message.\r
+               /// </summary>\r
+               public string BareMessage\r
+               {\r
+                       get \r
+                       {\r
+                               return _stringBareMessage;\r
+                       }\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Gets the name of the configuration file where the error occurred.\r
+               /// </summary>\r
+               public string Filename\r
+               {\r
+                       get \r
+                       {\r
+                               return _stringFilename;\r
+                       }\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Returns the line number where the error occurred.\r
+               /// </summary>\r
+               public int Line\r
+               {\r
+                       get \r
+                       {\r
+                               return _intLine;\r
+                       }\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Gets a string containing the concatenated file name and line number where the error occurred.\r
+               /// </summary>\r
+               public override string Message\r
+               {\r
+                       get \r
+                       {\r
+                               return _stringMessage;\r
+                       }\r
+               }\r
+       }\r
+}\r
+       
\ No newline at end of file
index 86fcb9a764fb142a45cef78d192d7721d40d8c2b..76c685a23495e53be64308669c2b097a9fb28e91 100644 (file)
@@ -8,7 +8,11 @@
 //
 
 using System;
+using System.Collections;
 using System.Collections.Specialized;
+using System.Xml;
+using System.Xml.XPath;
+using System.Windows.Forms;
 
 namespace System.Configuration
 {
@@ -22,15 +26,15 @@ namespace System.Configuration
        public sealed class ConfigurationSettings
        {
 
-               private NameValueCollection appsettings;
-
-
+               static NameValueCollection _nvcAppSettings;
+               private static string applicationConfigFileName;
+               
                /// <summary>
                ///             ConfigurationSettings Constructor.
                /// </summary>
                public ConfigurationSettings ()
                {
-                       appsettings = new NameValueCollection();
+                       
                }
 
                /// <summary>
@@ -38,22 +42,75 @@ namespace System.Configuration
                /// </summary>
                /// <param name="sectionName"></param>
                /// <returns></returns>
-               public static object GetConfig( string sectionName)
+               public static object GetConfig(string sectionName)
                {
-                       //FIXME: Not sure how to determine the correct .config file to parse.
-                       return null;
+                       //Create an instance of an XML Document.
+                       XmlDocument ConfigurationDocument = new XmlDocument();
+                       XmlNode sectionNode;
+
+
+                       
+                       /*
+                        * LAMESPEC: The .config file that needs to be parsed is the name of the application, plus ".config"
+                        * ie. "Myapplication.exe.config"
+                        * The only way I could find to get the name of the application is through System.Forms.Application.ExecutablePath, this
+                        * may be an incorrect way to get this information.  It works properly on a windows machine when building an executable,
+                        * however, I'm not sure how this would work under other platforms.
+                       */
+                       //Get the full path to the Applicaton Configuration File.
+                       applicationConfigFileName = Application.ExecutablePath + ".config";
+                       
+                       //Create a new NameValueSectionHandler
+                       NameValueSectionHandler objNVSHandler = new NameValueSectionHandler();
+
+                       //Try to load the XML Document.
+                       try
+                       { 
+                               ConfigurationDocument.Load(applicationConfigFileName);
+                               sectionNode = ConfigurationDocument.SelectSingleNode("//" + sectionName);
+                       }
+                       catch(XmlException)
+                       {
+                               //If an XmlException is thrown, it probably means that the .config file we are trying to load doesn't exist.
+                               return null;
+                       }
+                       catch(XPathException)
+                       {       
+                               //An XPathException is thrown if there was a problem with our XPath statement.
+                               return null;    
+                       }
+                       
+                       //If the specified sectionName is not found, then sectionNode will be null, and we can't pass
+                       // a null to objNVSHandler.Create()
+                        if(sectionNode == null)
+                       {
+                               return null;
+                       }
+                       
+                       //Create a NameValueSecitonHandler and add it to the NameValueCollection
+                       object readOnlyNVCollection = objNVSHandler.Create(null, null, sectionNode);
+
+                       
+                       //Return the collection
+                       return readOnlyNVCollection;
                }
 
                /// <summary>
                ///             Get the Application Configuration Settings.
                /// </summary>
-               public NameValueCollection AppSettings
+               public static NameValueCollection AppSettings
                {
                        get
-                       {
-                               return appsettings;
+                       {       //Define appSettings as a NameValueCollection.
+                               NameValueCollection appSettings;
+
+                               //Get the Configuration Settings for the "appSettings" section.
+                               appSettings = (NameValueCollection) GetConfig("appSettings");;
+
+                               return appSettings;
                        }
                }
+
        }
 }
 
diff --git a/mcs/class/System/System.Configuration/DictionarySectionHandler.cs b/mcs/class/System/System.Configuration/DictionarySectionHandler.cs
new file mode 100644 (file)
index 0000000..c361a1b
--- /dev/null
@@ -0,0 +1,90 @@
+\r
+//\r
+// System.Configuration.DictionarySectionHandler.cs\r
+//\r
+// Author:\r
+//   Christopher Podurgiel (cpodurgiel@msn.com)\r
+//\r
+// (C) Chris Podurgiel\r
+//\r
+using System;\r
+using System.Collections.Specialized;\r
+using System.Xml;\r
+\r
+namespace System.Configuration\r
+{\r
+       /// <summary>\r
+       /// Summary description for DictionarySectionHandler.\r
+       /// </summary>\r
+       public class DictionarySectionHandler : IConfigurationSectionHandler\r
+       {\r
+               private static string _stringKeyName;\r
+               private static string _stringValueName;\r
+\r
+               /// <summary>\r
+               ///             DictionarySectionHandler Constructor\r
+               /// </summary>\r
+               public DictionarySectionHandler()\r
+               {\r
+                       //Set Default Values.\r
+                       _stringKeyName = "key";\r
+                       _stringValueName = "value";\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Creates a new DictionarySectionHandler object and adds the object to the collection.\r
+               /// </summary>\r
+               /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>\r
+               /// <param name="context">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>\r
+               /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>\r
+               /// <returns></returns>\r
+               public object Create(object parent, object context, XmlNode section)\r
+               {\r
+                       //FIXME: Enter a meaningful error message\r
+                       if(section == null)\r
+                       { throw new ConfigurationException("XML Node can not be null."); }\r
+                       \r
+                       //FIXME: Enter a meaningful error message\r
+                       if(parent == null)\r
+                       { throw new ConfigurationException("", section); }\r
+\r
+                       \r
+                       DictionarySectionHandler objHandler = new DictionarySectionHandler();\r
+                       NameValueCollection objCollection;\r
+                       \r
+                       //Unbox parent as a NameValueCollection type.\r
+                       objCollection=(NameValueCollection)parent;\r
+\r
+                       objCollection.Add(section.Attributes[_stringKeyName].Value, section.Attributes[_stringValueName].Value);\r
+                        \r
+                       return null;\r
+\r
+                       //FIXME: this code is far form complete, probably not even correct.\r
+                       \r
+               }\r
+\r
+               /// <summary>\r
+               ///             Gets the name of the key attribute tag. This property is overidden by derived classes to change \r
+               ///             the name of the key attribute tag. The default is "key".\r
+               /// </summary>\r
+               protected virtual string KeyAttributeName\r
+               {\r
+                       get\r
+                       {\r
+                               return _stringKeyName;\r
+                       }\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Gets the name of the value tag. This property may be overidden by derived classes to change\r
+               ///             the name of the value tag. The default is "value".\r
+               /// </summary>\r
+               protected virtual string ValueAttributeName \r
+               {\r
+                       get\r
+                       {\r
+                               return _stringValueName;\r
+                       }\r
+               }\r
+       }\r
+}\r
index 444ce757f231120998beb38f1e7179732375ea20..bb10ae8a63ca736441ac0f9297e82adf3da31c00 100644 (file)
@@ -1,30 +1,28 @@
-//
-// System.Configuration.IConfigurationSectionHandler.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-using System;
-using System.Xml;
-
-namespace System.Configuration
-{
-       /// <summary>
-       /// Summary description for IConfigurationSectionHandler.
-       /// </summary>
-       public interface IConfigurationSectionHandler
-       {
-               /// <summary>
-               ///             Creates a new configuration handler and adds the specified configuration object to the collection.
-               /// </summary>
-               /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
-               /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
-               /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
-               /// <returns></returns>
-               object Create(object parent, object configContext, XmlNode section);
-       }
-}
-
-
+//\r
+// System.Configuration.IConfigurationSectionHandler.cs\r
+//\r
+// Author:\r
+//   Christopher Podurgiel (cpodurgiel@msn.com)\r
+//\r
+// (C) Chris Podurgiel\r
+//\r
+using System;\r
+using System.Xml;\r
+\r
+namespace System.Configuration\r
+{\r
+       /// <summary>\r
+       /// Summary description for IConfigurationSectionHandler.\r
+       /// </summary>\r
+       public interface IConfigurationSectionHandler\r
+       {\r
+               /// <summary>\r
+               ///             Creates a new configuration handler and adds the specified configuration object to the collection.\r
+               /// </summary>\r
+               /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>\r
+               /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>\r
+               /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>\r
+               /// <returns></returns>\r
+               object Create(object parent, object configContext, XmlNode section);\r
+       }\r
+}\r
index 9147c23f310be0f935cc4b30fbf72ad050d090bf..4b31428b839a66ded545705610faa3df39c5d8fb 100644 (file)
@@ -1,45 +1,43 @@
-//
-// System.Configuration.IgnoreSectionHandler.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-
-using System;
-using System.Xml;
-
-namespace System.Configuration
-{
-       /// <summary>
-       /// Summary description for IgnoreSectionHandler.
-       /// </summary>
-       public class IgnoreSectionHandler : IConfigurationSectionHandler
-       {
-               /// <summary>
-               ///             IgnoreSectionHandler Constructor
-               /// </summary>
-               public IgnoreSectionHandler()
-               {
-                       //
-                       // TODO: Add constructor logic here
-                       //
-               }
-
-               /// <summary>
-               ///             Creates a new configuration handler and adds the specified configuration object to the collection.
-               /// </summary>
-               /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
-               /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
-               /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
-               /// <returns></returns>
-               public virtual object Create(object parent, object configContext, XmlNode section)
-               {
+//\r
+// System.Configuration.IgnoreSectionHandler.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
+namespace System.Configuration\r
+{\r
+       /// <summary>\r
+       /// Summary description for IgnoreSectionHandler.\r
+       /// </summary>\r
+       public class IgnoreSectionHandler : IConfigurationSectionHandler\r
+       {\r
+               /// <summary>\r
+               ///             IgnoreSectionHandler Constructor\r
+               /// </summary>\r
+               public IgnoreSectionHandler()\r
+               {\r
+                       //\r
+                       // TODO: Add constructor logic here\r
+                       //\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Creates a new configuration handler and adds the specified configuration object to the collection.\r
+               /// </summary>\r
+               /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>\r
+               /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>\r
+               /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>\r
+               /// <returns></returns>\r
+               public virtual object Create(object parent, object configContext, XmlNode section)\r
+               {\r
                        //FIXME: Add Implemetation code here.\r
-                       return null;
-               }
-       }
-}
-
-
+                       return null;\r
+               }\r
+       }\r
+}\r
index 4f4cc9a1f7f0dbc7948eb8359b99b9278924c8ea..af9985e0f41f99b7fccb3c2574b8786bf91b6517 100644 (file)
@@ -1,70 +1,68 @@
-//
-// System.Configuration.NameValueSectionHandler.cs
-//
-// Author:
-//   Christopher Podurgiel (cpodurgiel@msn.com)
-//
-// (C) Ximian, Inc.  http://www.ximian.com
-//
-using System;
-using System.Xml;
-
-namespace System.Configuration
-{
-       /// <summary>
-       /// Summary description for NameValueSectionHandler.
-       /// </summary>
-       public class NameValueSectionHandler : IConfigurationSectionHandler
-       {
-
-               private static string _stringKey;
-               private static string _stringValue;
-
-               /// <summary>
-               ///             NameValueSectionHandler Constructor
-               /// </summary>
-               public NameValueSectionHandler()
-               {
-                       _stringKey = "key";
-                       _stringValue = "value";
-               }
-
-               /// <summary>
-               ///             Creates a new configuration handler and adds the specified configuration object to the collection.
-               /// </summary>
-               /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>
-               /// <param name="configContext">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>
-               /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents of the configuration section.</param>
-               /// <returns></returns>
-               public object Create(object parent, object context, XmlNode section)
-               {
+//\r
+// System.Configuration.NameValueSectionHandler.cs\r
+//\r
+// Author:\r
+//   Christopher Podurgiel (cpodurgiel@msn.com)\r
+//\r
+// (C) Chris Podurgiel\r
+//\r
+using System;\r
+using System.Xml;\r
+\r
+namespace System.Configuration\r
+{\r
+       /// <summary>\r
+       /// Summary description for NameValueSectionHandler.\r
+       /// </summary>\r
+       public class NameValueSectionHandler : IConfigurationSectionHandler\r
+       {\r
+               private static string _stringKey;\r
+               private static string _stringValue;\r
+\r
+               /// <summary>\r
+               ///             NameValueSectionHandler Constructor\r
+               /// </summary>\r
+               public NameValueSectionHandler()\r
+               {\r
+                       //Set Default Values.\r
+                       _stringKey = "key";\r
+                       _stringValue = "value";\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Creates a new configuration handler and adds the specified configuration object to the collection.\r
+               /// </summary>\r
+               /// <param name="parent">Composed from the configuration settings in a corresponding parent configuration section.</param>\r
+               /// <param name="context">Provides access to the virtual path for which the configuration section handler computes configuration values. Normally this parameter is reserved and is null.</param>\r
+               /// <param name="section">The XML node that contains the configuration information to be handled. section provides direct access to the XML contents 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;
-               }
-
-               /// <summary>
-               ///             Gets the name of the key in the key-value pair.
-               /// </summary>
-               protected virtual string KeyAttributeName
-               {
-                       get
-                       {
-                               return _stringKey;
-                       }
-               }
-
-               /// <summary>
-               ///             Gets the value for the key in the key-value pair.
-               /// </summary>
-               protected virtual string ValueAttributeName
-               {
-                       get
-                       {
-                               return _stringValue;
-                       }
-               }
-
-       }
-}
-
-
+                       return null;\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Gets the name of the key in the key-value pair.\r
+               /// </summary>\r
+               protected virtual string KeyAttributeName\r
+               {\r
+                       get\r
+                       {\r
+                               return _stringKey;\r
+                       }\r
+               }\r
+\r
+               /// <summary>\r
+               ///             Gets the value for the key in the key-value pair.\r
+               /// </summary>\r
+               protected virtual string ValueAttributeName \r
+               {\r
+                       get\r
+                       {\r
+                               return _stringValue;\r
+                       }\r
+               }\r
+\r
+       }\r
+}\r
diff --git a/mcs/class/System/System.Configuration/SingleTagSectionHandler.cs b/mcs/class/System/System.Configuration/SingleTagSectionHandler.cs
new file mode 100644 (file)
index 0000000..dcaf64c
--- /dev/null
@@ -0,0 +1,42 @@
+//\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
index c01031797f9b8815ae99eba0ca614fe4bb1b7c21..6781596d540683b53155ccd1d692767f514d8dc6 100644 (file)
@@ -1,4 +1,7 @@
-ConfigurationException.cs
-IConfigurationSectionHandler.cs
-IgnoreSectionHandler.cs
-NameValueSectionHandler.cs
+ConfigurationException.cs\r
+ConfigurationSettings.cs\r
+DictionarySectionHandler.cs\r
+IConfigurationSectionHandler.cs\r
+IgnoreSectionHandler.cs\r
+NameValueSectionHandler.cs\r
+SingleTagSectionHandler.cs\r