* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System / System.Net.Configuration / ProxyElement.cs
1 //
2 // System.Net.Configuration.ProxyElement.cs
3 //
4 // Authors:
5 //      Tim Coleman (tim@timcoleman.com)
6 //      Chris Toshok (toshok@ximian.com)
7 //
8 // Copyright (C) Tim Coleman, 2004
9 // (C) 2004,2005 Novell, Inc. (http://www.novell.com)
10 //
11
12 //
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:
20 // 
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 // 
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.
31 //
32
33 #if NET_2_0 && CONFIGURATION_DEP
34
35 using System;
36 using System.Configuration;
37
38 namespace System.Net.Configuration 
39 {
40         public sealed class ProxyElement : ConfigurationElement
41         {
42                 #region Fields
43
44                 static ConfigurationPropertyCollection properties;
45                 static ConfigurationProperty autoDetectProp;
46                 static ConfigurationProperty bypassOnLocalProp;
47                 static ConfigurationProperty proxyAddressProp;
48                 static ConfigurationProperty scriptLocationProp;
49                 static ConfigurationProperty useSystemDefaultProp;
50
51                 #endregion // Fields
52
53                 #region Constructors
54
55                 static ProxyElement ()
56                 {
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);
62
63                         properties = new ConfigurationPropertyCollection ();
64                                                                     
65                         properties.Add (bypassOnLocalProp);
66                         properties.Add (proxyAddressProp);
67                         properties.Add (scriptLocationProp);
68                         properties.Add (useSystemDefaultProp);
69                 }
70
71                 public ProxyElement ()
72                 {
73                 }
74
75                 #endregion // Constructors
76
77                 #region Properties
78
79                 [ConfigurationProperty ("autoDetect", DefaultValue = "Unspecified")]
80                 public AutoDetectValues AutoDetect {
81                         get { return (AutoDetectValues) base [autoDetectProp]; }
82                         set { base [autoDetectProp] = value; }
83                 }
84
85                 [ConfigurationProperty ("bypassonlocal", DefaultValue = "Unspecified")]
86                 public BypassOnLocalValues BypassOnLocal {
87                         get { return (BypassOnLocalValues) base [bypassOnLocalProp]; }
88                         set { base [bypassOnLocalProp] = value; }
89                 }
90
91                 [ConfigurationProperty ("proxyaddress")]
92                 public Uri ProxyAddress {
93                         get { return (Uri) base [proxyAddressProp]; }
94                         set { base [proxyAddressProp] = value; }
95                 }
96
97                 [ConfigurationProperty ("scriptLocation")]
98                 public Uri ScriptLocation {
99                         get { return (Uri) base [scriptLocationProp]; }
100                         set { base [scriptLocationProp] = value; }
101                 }
102
103                 [ConfigurationProperty ("usesystemdefault", DefaultValue = "Unspecified")]
104                 public UseSystemDefaultValues UseSystemDefault {
105                         get { return (UseSystemDefaultValues) base [useSystemDefaultProp]; }
106                         set { base [useSystemDefaultProp] = value; }
107                 }
108
109                 protected override ConfigurationPropertyCollection Properties {
110                         get { return properties; }
111                 }
112
113                 #endregion // Properties
114
115                 public enum BypassOnLocalValues
116                 {
117                         Unspecified = -1,
118                         True = 1,
119                         False = 0
120                 }
121
122                 public enum UseSystemDefaultValues
123                 {
124                         Unspecified = -1,
125                         True = 1,
126                         False = 0
127                 }
128
129                 public enum AutoDetectValues
130                 {
131                         Unspecified = -1,
132                         True = 1,
133                         False = 0
134                 }
135         }
136 }
137
138 #endif