Merge pull request #4618 from BrzVlad/feature-par-nrs
[mono.git] / mcs / class / System / System.Net.Configuration / NetConfigurationHandler.cs
index 2b825231511253c3ea3ca5be3eef49227cbb11cd..59f648186e9bbb246af110b7dbf56b87f2de672b 100644 (file)
@@ -34,20 +34,21 @@ using System.Collections;
 using System.Configuration;
 #if (XML_DEP)
 using System.Xml;
+#else
+using XmlNode = System.Object;
 #endif
 
 namespace System.Net.Configuration
 {
        class NetConfigurationHandler : IConfigurationSectionHandler
        {
-#if (XML_DEP)
                public virtual object Create (object parent, object configContext, XmlNode section)
                {
+                       NetConfig config = new NetConfig ();
+#if (XML_DEP)
                        if (section.Attributes != null && section.Attributes.Count != 0)
                                HandlersUtil.ThrowException ("Unrecognized attribute", section);
 
-                       NetConfig config = new NetConfig ();
-
                        XmlNodeList reqHandlers = section.ChildNodes;
                        foreach (XmlNode child in reqHandlers) {
                                XmlNodeType ntype = child.NodeType;
@@ -89,7 +90,7 @@ namespace System.Net.Configuration
 
                                                        config.MaxResponseHeadersLength = val;
                                                }
-                                       } catch (Exception e) {
+                                       } catch {
                                                HandlersUtil.ThrowException ("Invalid int value", child);
                                        }
 
@@ -98,9 +99,9 @@ namespace System.Net.Configuration
 
                                HandlersUtil.ThrowException ("Unexpected element", child);
                        }
+#endif                 
 
                        return config;
                }
-#endif
        }
 }