2007-05-10 Nagappan A <anagappan@novell.com>
[mono.git] / mcs / class / Mono.Data / ProviderSectionHandler.cs
old mode 100755 (executable)
new mode 100644 (file)
index 3f916a9..ae552da
@@ -37,21 +37,26 @@ namespace Mono.Data
 {
        public class ProviderSectionHandler : IConfigurationSectionHandler
        {
-               public virtual object Create(object parent,object configContext,XmlNode section)
+               public virtual object Create (object parent, object configContext, XmlNode section)
                {
-                       ProviderCollection providers=new ProviderCollection();
+                       if (section == null)
+                               throw new System.ArgumentNullException ("section");
+
+                       ProviderCollection providers = new ProviderCollection ();
                        
                        XmlNodeList ProviderList = section.SelectNodes ("./provider");
 
                        foreach (XmlNode ProviderNode in ProviderList) {
-                               Provider provider=new Provider(
-                                       GetStringValue(ProviderNode,"name",true),
-                                       GetStringValue(ProviderNode,"connection",true),
-                                       GetStringValue(ProviderNode,"adapter",true),
-                                       GetStringValue(ProviderNode,"command",true),
-                                       GetStringValue(ProviderNode,"assembly",true),
-                                       GetStringValue(ProviderNode,"description",false));
-                               providers.Add(provider);
+                               Provider provider = new Provider(
+                                       GetStringValue (ProviderNode, "name", true),
+                                       GetStringValue (ProviderNode, "connection", true),
+                                       GetStringValue (ProviderNode, "adapter", true),
+                                       GetStringValue (ProviderNode, "command", true),
+                                       GetStringValue (ProviderNode, "assembly", true),
+                                       GetStringValue (ProviderNode, "description", false),
+                                       GetStringValue (ProviderNode, "parameterprefix", false),
+                                       GetStringValue (ProviderNode, "commandbuilder", false));
+                               providers.Add (provider);
                        }
                        return providers;
                }