* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System / System.Net.Configuration / BypassElement.cs
old mode 100755 (executable)
new mode 100644 (file)
index 3378170..a017ae8
@@ -3,9 +3,10 @@
 //
 // Authors:
 //     Tim Coleman (tim@timcoleman.com)
+//     Chris Toshok (toshok@ximian.com)
 //
 // Copyright (C) Tim Coleman, 2004
-// (c) 2004 Novell, Inc. (http://www.novell.com)
+// (C) 2004,2005 Novell, Inc. (http://www.novell.com)
 //
 
 //
@@ -29,7 +30,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
+#if NET_2_0 && CONFIGURATION_DEP
 
 using System.Configuration;
 
@@ -39,21 +40,27 @@ namespace System.Net.Configuration
        {
                #region Fields
 
-               ConfigurationPropertyCollection properties;
-               static ConfigurationProperty address = new ConfigurationProperty ("Address", typeof (string), null);
+               static ConfigurationPropertyCollection properties;
+               static ConfigurationProperty addressProp;
 
                #endregion // Fields
 
                #region Constructors
 
-               public BypassElement ()
+               static BypassElement ()
                {
+                       addressProp = new ConfigurationProperty ("Address", typeof (string),
+                                                                null, ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey);
+
                        properties = new ConfigurationPropertyCollection ();
-                       properties.Add (address);
+                       properties.Add (addressProp);
+               }
+
+               public BypassElement ()
+               {
                }
 
                public BypassElement (string address)
-                       : this ()
                {
                        Address = address;
                }
@@ -62,12 +69,13 @@ namespace System.Net.Configuration
 
                #region Properties
 
+               [ConfigurationProperty ("address", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]
                public string Address {
-                       get { return (string) base [address]; }
-                       set { base [address] = value; }
+                       get { return (string) base [addressProp]; }
+                       set { base [addressProp] = value; }
                }
 
-               protected internal override ConfigurationPropertyCollection Properties {
+               protected override ConfigurationPropertyCollection Properties {
                        get { return properties; }
                }