merge -r 58784:58785
[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, is_protected;
48                 string name, type_name;
49
50                 ProtectedConfigurationProvider protected_provider;
51                 
52                 internal SectionInformation ()
53                 {
54                         allow_definition = ConfigurationAllowDefinition.Everywhere;
55                         allow_location = true;
56                         allow_override = true;
57                         inherit_on_child_apps = true;
58                         restart_on_external_changes = true;
59                 }
60                 
61                 public ConfigurationAllowDefinition AllowDefinition {
62                         get { return allow_definition; }
63                         set { allow_definition = value; }
64                 }
65
66                 public ConfigurationAllowExeDefinition AllowExeDefinition {
67                         get { return allow_exe_definition; }
68                         set { allow_exe_definition = value; }
69                 }
70
71                 public bool AllowLocation {
72                         get { return allow_location; }
73                         set { allow_location = value; }
74                 }
75
76                 public bool AllowOverride {
77                         get { return allow_override; }
78                         set { allow_override = value; }
79                 }
80
81                 public string ConfigSource {
82                         get { return config_source; }
83                         set { config_source = value; }
84                 }
85
86                 public bool ForceSave {
87                         get { return force_update; }
88                         set { force_update = value; }
89                 }
90
91                 public bool InheritInChildApplications {
92                         get { return inherit_on_child_apps; }
93                         set { inherit_on_child_apps = value; }
94                 }
95
96                 [MonoTODO]
97                 public bool IsDeclarationRequired {
98                         get { throw new NotImplementedException (); }
99                 }
100
101                 [MonoTODO]
102                 public bool IsDeclared {
103                         get { return is_declared; }
104                 }
105
106                 [MonoTODO]
107                 public bool IsLocked {
108                         get { return is_locked; }
109                 }
110
111                 [MonoTODO]
112                 public bool IsProtected {
113                         get { return is_protected; }
114                 }
115
116                 public string Name {
117                         get { return name; }
118                 }
119
120                 [MonoTODO]
121                 public ProtectedConfigurationProvider ProtectionProvider {
122                         get { return protected_provider; }
123                 }
124
125                 [MonoTODO]
126                 public bool RequirePermission {
127                         get { throw new NotImplementedException (); }
128                         set { throw new NotImplementedException (); }
129                 }
130
131                 [MonoTODO]
132                 public bool RestartOnExternalChanges {
133                         get { return restart_on_external_changes; }
134                         set { restart_on_external_changes = value; }
135                 }
136
137                 [MonoTODO]
138                 public string SectionName {
139                         get { throw new NotImplementedException (); }
140                 }
141
142                 public string Type {
143                         get { return type_name; }
144                         set { type_name = value; }
145                 }
146
147                 [MonoTODO]
148                 public ConfigurationSection GetParentSection ()
149                 {
150                         return parent;
151                 }
152
153                 [MonoTODO]
154                 public string GetRawXml ()
155                 {
156                         throw new NotImplementedException ();
157                 }
158
159                 [MonoTODO]
160                 public void ProtectSection (string provider)
161                 {
162                         throw new NotImplementedException ();
163                 }
164
165                 [MonoTODO]
166                 public void ForceDeclaration (bool require)
167                 {
168                 }
169
170                 public void ForceDeclaration ()
171                 {
172                         ForceDeclaration (true);
173                 }
174
175                 [MonoTODO]
176                 public void RevertToParent ()
177                 {
178                         throw new NotImplementedException ();
179                 }
180
181                 [MonoTODO]
182                 public void UnprotectSection ()
183                 {
184                         throw new NotImplementedException ();
185                 }
186
187                 [MonoTODO]
188                 public void SetRawXml (string xml)
189                 {
190                         throw new NotImplementedException ();
191                 }
192                 
193                 [MonoTODO]
194                 internal void SetName (string name)
195                 {
196                         this.name = name;
197                 }
198         }
199 }
200 #endif