2 // System.Configuration.Internal.IConfigErrorInfo.cs
5 // Lluis Sanchez Gual (lluis@novell.com)
7 // Permission is hereby granted, free of charge, to any person obtaining
8 // a copy of this software and associated documentation files (the
9 // "Software"), to deal in the Software without restriction, including
10 // without limitation the rights to use, copy, modify, merge, publish,
11 // distribute, sublicense, and/or sell copies of the Software, and to
12 // permit persons to whom the Software is furnished to do so, subject to
13 // the following conditions:
15 // The above copyright notice and this permission notice shall be
16 // included in all copies or substantial portions of the Software.
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
33 using System.Security;
35 namespace System.Configuration.Internal
37 public class DelegatingConfigHost: IInternalConfigHost
39 IInternalConfigHost host;
41 protected DelegatingConfigHost ()
45 protected IInternalConfigHost Host {
50 public virtual object CreateConfigurationContext (string configPath, string locationSubPath)
52 return host.CreateConfigurationContext (configPath, locationSubPath);
55 public virtual object CreateDeprecatedConfigContext (string configPath)
57 return host.CreateDeprecatedConfigContext (configPath);
60 public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
62 return host.DecryptSection (encryptedXml, protectionProvider, protectedSection);
65 public virtual void DeleteStream (string streamName)
67 host.DeleteStream (streamName);
70 public virtual string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
72 return host.EncryptSection (encryptedXml, protectionProvider, protectedSection);
75 public virtual string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath)
77 return host.GetConfigPathFromLocationSubPath (configPath, locatinSubPath);
80 public virtual Type GetConfigType (string typeName, bool throwOnError)
82 return host.GetConfigType (typeName, throwOnError);
85 public virtual string GetConfigTypeName (Type t)
87 return host.GetConfigTypeName (t);
90 public virtual void GetRestrictedPermissions (IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady)
92 host.GetRestrictedPermissions (configRecord, out permissionSet, out isHostReady);
95 public virtual string GetStreamName (string configPath)
97 return host.GetStreamName (configPath);
100 public virtual string GetStreamNameForConfigSource (string streamName, string configSource)
102 return host.GetStreamNameForConfigSource (streamName, configSource);
105 public virtual object GetStreamVersion (string streamName)
107 return host.GetStreamVersion (streamName);
110 public virtual IDisposable Impersonate ()
112 return host.Impersonate ();
115 public virtual void Init (IInternalConfigRoot root, params object[] hostInitParams)
117 host.Init (root, hostInitParams);
120 public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams)
122 host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, root, hostInitConfigurationParams);
125 public virtual bool IsAboveApplication (string configPath)
127 return host.IsAboveApplication (configPath);
130 public virtual bool IsConfigRecordRequired (string configPath)
132 return host.IsConfigRecordRequired (configPath);
135 public virtual bool IsDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition)
137 return host.IsDefinitionAllowed (configPath, allowDefinition, allowExeDefinition);
140 public virtual bool IsInitDelayed (IInternalConfigRecord configRecord)
142 return host.IsInitDelayed (configRecord);
145 public virtual bool IsFile (string streamName)
147 return host.IsFile (streamName);
150 public bool IsFullTrustSectionWithoutAptcaAllowed (IInternalConfigRecord configRecord)
152 return host.IsFullTrustSectionWithoutAptcaAllowed (configRecord);
155 public virtual bool IsLocationApplicable (string configPath)
157 return host.IsLocationApplicable (configPath);
160 public bool IsRemote {
161 get { return host.IsRemote; }
164 public bool IsSecondaryRoot (string configPath)
166 return host.IsSecondaryRoot (configPath);
169 public bool IsTrustedConfigPath (string configPath)
171 return host.IsTrustedConfigPath (configPath);
174 public virtual Stream OpenStreamForRead (string streamName)
176 return host.OpenStreamForRead (streamName);
179 public Stream OpenStreamForRead (string streamName, bool assertPermissions)
181 return host.OpenStreamForRead (streamName, assertPermissions);
184 public virtual Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext)
186 return host.OpenStreamForWrite (streamName, templateStreamName, ref writeContext);
189 public Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext, bool assertPermissions)
191 return host.OpenStreamForWrite (streamName, templateStreamName, ref writeContext, assertPermissions);
194 public virtual bool PrefetchAll (string configPath, string streamName)
196 return host.PrefetchAll (configPath, streamName);
199 public virtual bool PrefetchSection (string sectionGroupName, string sectionName)
201 return host.PrefetchSection (sectionGroupName, sectionName);
204 public virtual void RequireCompleteInit (IInternalConfigRecord configRecord)
206 host.RequireCompleteInit (configRecord);
209 public virtual object StartMonitoringStreamForChanges (string streamName, StreamChangeCallback callback)
211 return host.StartMonitoringStreamForChanges (streamName, callback);
214 public virtual void StopMonitoringStreamForChanges (string streamName, StreamChangeCallback callback)
216 host.StopMonitoringStreamForChanges (streamName, callback);
219 public virtual void VerifyDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition, IConfigErrorInfo errorInfo)
221 host.VerifyDefinitionAllowed (configPath, allowDefinition, allowExeDefinition, errorInfo);
224 public virtual void WriteCompleted (string streamName, bool success, object writeContext)
226 host.WriteCompleted (streamName, success, writeContext);
229 public void WriteCompleted (string streamName, bool success, object writeContext, bool assertPermissions)
231 host.WriteCompleted (streamName, success, writeContext, assertPermissions);
234 public virtual bool SupportsChangeNotifications {
235 get { return host.SupportsChangeNotifications; }
238 public virtual bool SupportsLocation {
239 get { return host.SupportsLocation; }
242 public virtual bool SupportsPath {
243 get { return host.SupportsPath; }
246 public virtual bool SupportsRefresh {
247 get { return host.SupportsRefresh; }