2 // System.Net.Configuration.ProxyElement.cs
5 // Tim Coleman (tim@timcoleman.com)
6 // Chris Toshok (toshok@ximian.com)
8 // Copyright (C) Tim Coleman, 2004
9 // (C) 2004,2005 Novell, Inc. (http://www.novell.com)
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 #if NET_2_0 && CONFIGURATION_DEP
36 using System.Configuration;
38 namespace System.Net.Configuration
40 public sealed class ProxyElement : ConfigurationElement
44 static ConfigurationPropertyCollection properties;
45 static ConfigurationProperty autoDetectProp;
46 static ConfigurationProperty bypassOnLocalProp;
47 static ConfigurationProperty proxyAddressProp;
48 static ConfigurationProperty scriptLocationProp;
49 static ConfigurationProperty useSystemDefaultProp;
55 static ProxyElement ()
57 autoDetectProp = new ConfigurationProperty ("autoDetect", typeof (AutoDetectValues), AutoDetectValues.Unspecified);
58 bypassOnLocalProp = new ConfigurationProperty ("bypassonlocal", typeof (BypassOnLocalValues), BypassOnLocalValues.Unspecified);
59 proxyAddressProp = new ConfigurationProperty ("proxyaddress", typeof (Uri), null);
60 scriptLocationProp = new ConfigurationProperty ("scriptLocation", typeof (Uri), null);
61 useSystemDefaultProp = new ConfigurationProperty ("UseSystemDefault", typeof (UseSystemDefaultValues), UseSystemDefaultValues.Unspecified);
63 properties = new ConfigurationPropertyCollection ();
65 properties.Add (bypassOnLocalProp);
66 properties.Add (proxyAddressProp);
67 properties.Add (scriptLocationProp);
68 properties.Add (useSystemDefaultProp);
71 public ProxyElement ()
75 #endregion // Constructors
79 [ConfigurationProperty ("autoDetect", DefaultValue = "Unspecified")]
80 public AutoDetectValues AutoDetect {
81 get { return (AutoDetectValues) base [autoDetectProp]; }
82 set { base [autoDetectProp] = value; }
85 [ConfigurationProperty ("bypassonlocal", DefaultValue = "Unspecified")]
86 public BypassOnLocalValues BypassOnLocal {
87 get { return (BypassOnLocalValues) base [bypassOnLocalProp]; }
88 set { base [bypassOnLocalProp] = value; }
91 [ConfigurationProperty ("proxyaddress")]
92 public Uri ProxyAddress {
93 get { return (Uri) base [proxyAddressProp]; }
94 set { base [proxyAddressProp] = value; }
97 [ConfigurationProperty ("scriptLocation")]
98 public Uri ScriptLocation {
99 get { return (Uri) base [scriptLocationProp]; }
100 set { base [scriptLocationProp] = value; }
103 [ConfigurationProperty ("usesystemdefault", DefaultValue = "Unspecified")]
104 public UseSystemDefaultValues UseSystemDefault {
105 get { return (UseSystemDefaultValues) base [useSystemDefaultProp]; }
106 set { base [useSystemDefaultProp] = value; }
109 protected override ConfigurationPropertyCollection Properties {
110 get { return properties; }
113 #endregion // Properties
115 public enum BypassOnLocalValues
122 public enum UseSystemDefaultValues
129 public enum AutoDetectValues