* support-test-*.cs: Rename from test-*-p2.cs.
[mono.git] / mcs / class / System.Configuration / System.Configuration / SectionInformation.cs
1 //
2 // System.Configuration.SectionInformation.cs
3 //
4 // Authors:
5 //      Duncan Mak (duncan@ximian.com)
6 //  Lluis Sanchez Gual (lluis@novell.com)
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining
9 // a copy of this software and associated documentation files (the
10 // "Software"), to deal in the Software without restriction, including
11 // without limitation the rights to use, copy, modify, merge, publish,
12 // distribute, sublicense, and/or sell copies of the Software, and to
13 // permit persons to whom the Software is furnished to do so, subject to
14 // the following conditions:
15 // 
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
18 // 
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 //
27 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
28 //
29
30 #if NET_2_0
31 using System.Collections;
32 using System.Xml;
33
34 namespace System.Configuration
35 {
36         public sealed class SectionInformation
37         {
38                 ConfigurationSection parent;
39                 
40                 ConfigurationAllowDefinition allow_definition = ConfigurationAllowDefinition.Everywhere;
41                 ConfigurationAllowExeDefinition allow_exe_definition = ConfigurationAllowExeDefinition.MachineToApplication;
42                 bool allow_location, allow_override;
43                 bool inherit_on_child_apps;
44                 bool restart_on_external_changes;
45
46                 string config_source;
47                 bool force_update, is_declared, is_locked;
48                 string name, type_name;
49                 string raw_xml;
50
51                 ProtectedConfigurationProvider protection_provider;
52                 
53                 internal SectionInformation ()
54                 {
55                         allow_definition = ConfigurationAllowDefinition.Everywhere;
56                         allow_location = true;
57                         allow_override = true;
58                         inherit_on_child_apps = true;
59                         restart_on_external_changes = true;
60                 }
61                 
62                 public ConfigurationAllowDefinition AllowDefinition {
63                         get { return allow_definition; }
64                         set { allow_definition = value; }
65                 }
66
67                 public ConfigurationAllowExeDefinition AllowExeDefinition {
68                         get { return allow_exe_definition; }
69                         set { allow_exe_definition = value; }
70                 }
71
72                 public bool AllowLocation {
73                         get { return allow_location; }
74                         set { allow_location = value; }
75                 }
76
77                 public bool AllowOverride {
78                         get { return allow_override; }
79                         set { allow_override = value; }
80                 }
81
82                 public string ConfigSource {
83                         get { return config_source; }
84                         set { config_source = value; }
85                 }
86
87                 public bool ForceSave {
88                         get { return force_update; }
89                         set { force_update = value; }
90                 }
91
92                 public bool InheritInChildApplications {
93                         get { return inherit_on_child_apps; }
94                         set { inherit_on_child_apps = value; }
95                 }
96
97                 [MonoTODO]
98                 public bool IsDeclarationRequired {
99                         get { throw new NotImplementedException (); }
100                 }
101
102                 [MonoTODO]
103                 public bool IsDeclared {
104                         get { return is_declared; }
105                 }
106
107                 [MonoTODO]
108                 public bool IsLocked {
109                         get { return is_locked; }
110                 }
111
112                 public bool IsProtected {
113                         get { return protection_provider != null; }
114                 }
115
116                 public string Name {
117                         get { return name; }
118                 }
119
120                 public ProtectedConfigurationProvider ProtectionProvider {
121                         get { return protection_provider; }
122                 }
123
124                 [MonoTODO]
125                 public bool RequirePermission {
126                         get { throw new NotImplementedException (); }
127                         set { throw new NotImplementedException (); }
128                 }
129
130                 [MonoTODO]
131                 public bool RestartOnExternalChanges {
132                         get { return restart_on_external_changes; }
133                         set { restart_on_external_changes = value; }
134                 }
135
136                 [MonoTODO]
137                 public string SectionName {
138                         get { return name; }
139                 }
140
141                 public string Type {
142                         get { return type_name; }
143                         set { type_name = value; }
144                 }
145
146                 [MonoTODO]
147                 public ConfigurationSection GetParentSection ()
148                 {
149                         return parent;
150                 }
151
152                 public string GetRawXml ()
153                 {
154                         return raw_xml;
155                 }
156
157                 public void ProtectSection (string provider)
158                 {
159                         protection_provider = ProtectedConfiguration.GetProvider (provider, true);
160                 }
161
162                 [MonoTODO]
163                 public void ForceDeclaration (bool require)
164                 {
165                 }
166
167                 public void ForceDeclaration ()
168                 {
169                         ForceDeclaration (true);
170                 }
171
172                 [MonoTODO]
173                 public void RevertToParent ()
174                 {
175                         throw new NotImplementedException ();
176                 }
177
178                 public void UnprotectSection ()
179                 {
180                         protection_provider = null;
181                 }
182
183                 public void SetRawXml (string xml)
184                 {
185                         raw_xml = xml;
186                 }
187
188                 [MonoTODO]
189                 internal void SetName (string name)
190                 {
191                         this.name = name;
192                 }
193         }
194 }
195 #endif