Merge pull request #439 from mono-soc-2012/garyb/iconfix
[mono.git] / mcs / class / System / System.Net.Configuration / SmtpSection.cs
index 04f3a1c9289d4c42832ea3c6e19a3edac6f2af6e..9d5f74bd0c14578c093fea2525c23d3b62a362be 100644 (file)
@@ -28,7 +28,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0 && CONFIGURATION_DEP
+#if CONFIGURATION_DEP
 
 using System;
 using System.Configuration;
@@ -38,53 +38,32 @@ namespace System.Net.Configuration {
 
         public sealed class SmtpSection : ConfigurationSection
         {
-                static ConfigurationProperty deliveryMethodProp;
-                static ConfigurationProperty fromProp;
-                static ConfigurationProperty networkProp;
-                static ConfigurationProperty specifiedPickupDirectoryProp;
-                static ConfigurationPropertyCollection properties;
-
-                static SmtpSection ()
-                {
-                        deliveryMethodProp = new ConfigurationProperty ("deliveryMethod", typeof (SmtpDeliveryMethod), SmtpDeliveryMethod.Network);
-                        fromProp = new ConfigurationProperty ("from", typeof (string));
-                        networkProp = new ConfigurationProperty ("network", typeof (SmtpNetworkElement));
-                        specifiedPickupDirectoryProp = new ConfigurationProperty ("specifiedPickupDirectory", typeof (SmtpSpecifiedPickupDirectoryElement));
-                        properties = new ConfigurationPropertyCollection ();
-
-                        properties.Add (deliveryMethodProp);
-                        properties.Add (fromProp);
-                        properties.Add (networkProp);
-                        properties.Add (specifiedPickupDirectoryProp);
-
-                }
-
                 [ConfigurationProperty ("deliveryMethod", DefaultValue = "Network")]
                 public SmtpDeliveryMethod DeliveryMethod {
-                        get { return (SmtpDeliveryMethod) base [deliveryMethodProp];}
-                        set { base[deliveryMethodProp] = value; }
+                                       get { return (SmtpDeliveryMethod) base ["deliveryMethod"]; }
+                                       set { base ["deliveryMethod"] = value; }
                 }
 
                 [ConfigurationProperty ("from")]
                 public string From {
-                        get { return (string) base [fromProp];}
-                        set { base[fromProp] = value; }
+                                       get { return (string) base ["from"]; }
+                                       set { base ["from"] = value; }
                 }
 
                 [ConfigurationProperty ("network")]
                 public SmtpNetworkElement Network {
-                        get { return (SmtpNetworkElement) base [networkProp];}
+                                       get { return (SmtpNetworkElement) base ["network"]; }
                 }
 
                 [ConfigurationProperty ("specifiedPickupDirectory")]
                 public SmtpSpecifiedPickupDirectoryElement SpecifiedPickupDirectory {
-                        get { return (SmtpSpecifiedPickupDirectoryElement) base [specifiedPickupDirectoryProp];}
-                }
-
-                protected override ConfigurationPropertyCollection Properties {
-                        get { return properties; }
+                                       get { return (SmtpSpecifiedPickupDirectoryElement) base ["specifiedPickupDirectory"]; }
                 }
 
+               protected override ConfigurationPropertyCollection Properties {
+                       // what to do here?
+                       get { return base.Properties; }
+               }
         }
 
 }