DelegatingConfigHost.cs 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. //
  2. // System.Configuration.Internal.IConfigErrorInfo.cs
  3. //
  4. // Authors:
  5. // Lluis Sanchez Gual ([email protected])
  6. //
  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:
  14. //
  15. // The above copyright notice and this permission notice shall be
  16. // included in all copies or substantial portions of the Software.
  17. //
  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.
  25. //
  26. // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
  27. //
  28. using System;
  29. using System.IO;
  30. using System.Security;
  31. namespace System.Configuration.Internal
  32. {
  33. public class DelegatingConfigHost: IInternalConfigHost
  34. {
  35. IInternalConfigHost host;
  36. protected DelegatingConfigHost ()
  37. {
  38. }
  39. protected IInternalConfigHost Host {
  40. get { return host; }
  41. set { host = value; }
  42. }
  43. public virtual object CreateConfigurationContext (string configPath, string locationSubPath)
  44. {
  45. return host.CreateConfigurationContext (configPath, locationSubPath);
  46. }
  47. public virtual object CreateDeprecatedConfigContext (string configPath)
  48. {
  49. return host.CreateDeprecatedConfigContext (configPath);
  50. }
  51. public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
  52. {
  53. return host.DecryptSection (encryptedXml, protectionProvider, protectedSection);
  54. }
  55. public virtual void DeleteStream (string streamName)
  56. {
  57. host.DeleteStream (streamName);
  58. }
  59. public virtual string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
  60. {
  61. return host.EncryptSection (encryptedXml, protectionProvider, protectedSection);
  62. }
  63. public virtual string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath)
  64. {
  65. return host.GetConfigPathFromLocationSubPath (configPath, locatinSubPath);
  66. }
  67. public virtual Type GetConfigType (string typeName, bool throwOnError)
  68. {
  69. return host.GetConfigType (typeName, throwOnError);
  70. }
  71. public virtual string GetConfigTypeName (Type t)
  72. {
  73. return host.GetConfigTypeName (t);
  74. }
  75. public virtual void GetRestrictedPermissions (IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady)
  76. {
  77. host.GetRestrictedPermissions (configRecord, out permissionSet, out isHostReady);
  78. }
  79. public virtual string GetStreamName (string configPath)
  80. {
  81. return host.GetStreamName (configPath);
  82. }
  83. public virtual string GetStreamNameForConfigSource (string streamName, string configSource)
  84. {
  85. return host.GetStreamNameForConfigSource (streamName, configSource);
  86. }
  87. public virtual object GetStreamVersion (string streamName)
  88. {
  89. return host.GetStreamVersion (streamName);
  90. }
  91. public virtual IDisposable Impersonate ()
  92. {
  93. return host.Impersonate ();
  94. }
  95. public virtual void Init (IInternalConfigRoot root, params object[] hostInitParams)
  96. {
  97. host.Init (root, hostInitParams);
  98. }
  99. public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams)
  100. {
  101. host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, root, hostInitConfigurationParams);
  102. }
  103. public virtual bool IsAboveApplication (string configPath)
  104. {
  105. return host.IsAboveApplication (configPath);
  106. }
  107. public virtual bool IsConfigRecordRequired (string configPath)
  108. {
  109. return host.IsConfigRecordRequired (configPath);
  110. }
  111. public virtual bool IsDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition)
  112. {
  113. return host.IsDefinitionAllowed (configPath, allowDefinition, allowExeDefinition);
  114. }
  115. public virtual bool IsInitDelayed (IInternalConfigRecord configRecord)
  116. {
  117. return host.IsInitDelayed (configRecord);
  118. }
  119. public virtual bool IsFile (string streamName)
  120. {
  121. return host.IsFile (streamName);
  122. }
  123. public virtual bool IsFullTrustSectionWithoutAptcaAllowed (IInternalConfigRecord configRecord)
  124. {
  125. return host.IsFullTrustSectionWithoutAptcaAllowed (configRecord);
  126. }
  127. public virtual bool IsLocationApplicable (string configPath)
  128. {
  129. return host.IsLocationApplicable (configPath);
  130. }
  131. public virtual bool IsRemote {
  132. get { return host.IsRemote; }
  133. }
  134. public virtual bool IsSecondaryRoot (string configPath)
  135. {
  136. return host.IsSecondaryRoot (configPath);
  137. }
  138. public virtual bool IsTrustedConfigPath (string configPath)
  139. {
  140. return host.IsTrustedConfigPath (configPath);
  141. }
  142. public virtual Stream OpenStreamForRead (string streamName)
  143. {
  144. return host.OpenStreamForRead (streamName);
  145. }
  146. public virtual Stream OpenStreamForRead (string streamName, bool assertPermissions)
  147. {
  148. return host.OpenStreamForRead (streamName, assertPermissions);
  149. }
  150. public virtual Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext)
  151. {
  152. return host.OpenStreamForWrite (streamName, templateStreamName, ref writeContext);
  153. }
  154. public virtual Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext, bool assertPermissions)
  155. {
  156. return host.OpenStreamForWrite (streamName, templateStreamName, ref writeContext, assertPermissions);
  157. }
  158. public virtual bool PrefetchAll (string configPath, string streamName)
  159. {
  160. return host.PrefetchAll (configPath, streamName);
  161. }
  162. public virtual bool PrefetchSection (string sectionGroupName, string sectionName)
  163. {
  164. return host.PrefetchSection (sectionGroupName, sectionName);
  165. }
  166. public virtual void RequireCompleteInit (IInternalConfigRecord configRecord)
  167. {
  168. host.RequireCompleteInit (configRecord);
  169. }
  170. public virtual object StartMonitoringStreamForChanges (string streamName, StreamChangeCallback callback)
  171. {
  172. return host.StartMonitoringStreamForChanges (streamName, callback);
  173. }
  174. public virtual void StopMonitoringStreamForChanges (string streamName, StreamChangeCallback callback)
  175. {
  176. host.StopMonitoringStreamForChanges (streamName, callback);
  177. }
  178. public virtual void VerifyDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition, IConfigErrorInfo errorInfo)
  179. {
  180. host.VerifyDefinitionAllowed (configPath, allowDefinition, allowExeDefinition, errorInfo);
  181. }
  182. public virtual void WriteCompleted (string streamName, bool success, object writeContext)
  183. {
  184. host.WriteCompleted (streamName, success, writeContext);
  185. }
  186. public virtual void WriteCompleted (string streamName, bool success, object writeContext, bool assertPermissions)
  187. {
  188. host.WriteCompleted (streamName, success, writeContext, assertPermissions);
  189. }
  190. public virtual bool SupportsChangeNotifications {
  191. get { return host.SupportsChangeNotifications; }
  192. }
  193. public virtual bool SupportsLocation {
  194. get { return host.SupportsLocation; }
  195. }
  196. public virtual bool SupportsPath {
  197. get { return host.SupportsPath; }
  198. }
  199. public virtual bool SupportsRefresh {
  200. get { return host.SupportsRefresh; }
  201. }
  202. }
  203. }