2 // System.Configuration.SectionInformation.cs
5 // Duncan Mak (duncan@ximian.com)
6 // Lluis Sanchez Gual (lluis@novell.com)
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:
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
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.
27 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
31 using System.Collections;
34 namespace System.Configuration
36 public sealed class SectionInformation
38 ConfigurationSection parent;
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 bool require_permission;
48 bool force_update, is_declared, is_locked;
49 string name, type_name;
52 ProtectedConfigurationProvider protection_provider;
55 [MonoTODO ("default value for require_permission")]
56 internal SectionInformation ()
58 allow_definition = ConfigurationAllowDefinition.Everywhere;
59 allow_location = true;
60 allow_override = true;
61 inherit_on_child_apps = true;
62 restart_on_external_changes = true;
65 public ConfigurationAllowDefinition AllowDefinition {
66 get { return allow_definition; }
67 set { allow_definition = value; }
70 public ConfigurationAllowExeDefinition AllowExeDefinition {
71 get { return allow_exe_definition; }
72 set { allow_exe_definition = value; }
75 public bool AllowLocation {
76 get { return allow_location; }
77 set { allow_location = value; }
80 public bool AllowOverride {
81 get { return allow_override; }
82 set { allow_override = value; }
85 public string ConfigSource {
86 get { return config_source; }
87 set { config_source = value; }
90 public bool ForceSave {
91 get { return force_update; }
92 set { force_update = value; }
95 public bool InheritInChildApplications {
96 get { return inherit_on_child_apps; }
97 set { inherit_on_child_apps = value; }
101 public bool IsDeclarationRequired {
102 get { throw new NotImplementedException (); }
106 public bool IsDeclared {
107 get { return is_declared; }
111 public bool IsLocked {
112 get { return is_locked; }
115 public bool IsProtected {
116 get { return protection_provider != null; }
123 public ProtectedConfigurationProvider ProtectionProvider {
124 get { return protection_provider; }
128 public bool RequirePermission {
129 get { return require_permission; }
130 set { require_permission = value; }
134 public bool RestartOnExternalChanges {
135 get { return restart_on_external_changes; }
136 set { restart_on_external_changes = value; }
140 public string SectionName {
145 get { return type_name; }
146 set { type_name = value; }
150 public ConfigurationSection GetParentSection ()
155 public string GetRawXml ()
160 public void ProtectSection (string provider)
162 protection_provider = ProtectedConfiguration.GetProvider (provider, true);
166 public void ForceDeclaration (bool require)
170 public void ForceDeclaration ()
172 ForceDeclaration (true);
176 public void RevertToParent ()
178 throw new NotImplementedException ();
181 public void UnprotectSection ()
183 protection_provider = null;
186 public void SetRawXml (string xml)
192 internal void SetName (string name)