DelegatingConfigHost.cs 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. #if NET_2_0
  29. using System;
  30. using System.IO;
  31. using System.Security;
  32. namespace System.Configuration.Internal
  33. {
  34. public class DelegatingConfigHost: IInternalConfigHost
  35. {
  36. IInternalConfigHost host;
  37. protected DelegatingConfigHost ()
  38. {
  39. }
  40. protected IInternalConfigHost Host {
  41. get { return host; }
  42. set { host = value; }
  43. }
  44. public virtual object CreateConfigurationContext (string configPath, string locationSubPath)
  45. {
  46. return host.CreateConfigurationContext (configPath, locationSubPath);
  47. }
  48. public virtual object CreateDeprecatedConfigContext (string configPath)
  49. {
  50. return host.CreateDeprecatedConfigContext (configPath);
  51. }
  52. public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
  53. {
  54. return host.DecryptSection (encryptedXml, protectionProvider, protectedSection);
  55. }
  56. public virtual void DeleteStream (string streamName)
  57. {
  58. host.DeleteStream (streamName);
  59. }
  60. public virtual string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
  61. {
  62. return host.EncryptSection (encryptedXml, protectionProvider, protectedSection);
  63. }
  64. public virtual string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath)
  65. {
  66. return host.GetConfigPathFromLocationSubPath (configPath, locatinSubPath);
  67. }
  68. public virtual Type GetConfigType (string typeName, bool throwOnError)
  69. {
  70. return host.GetConfigType (typeName, throwOnError);
  71. }
  72. public virtual string GetConfigTypeName (Type t)
  73. {
  74. return host.GetConfigTypeName (t);
  75. }
  76. public virtual void GetRestrictedPermissions (IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady)
  77. {
  78. host.GetRestrictedPermissions (configRecord, out permissionSet, out isHostReady);
  79. }
  80. public virtual string GetStreamName (string configPath)
  81. {
  82. return host.GetStreamName (configPath);
  83. }
  84. public virtual string GetStreamNameForConfigSource (string streamName, string configSource)
  85. {
  86. return host.GetStreamNameForConfigSource (streamName, configSource);
  87. }
  88. public virtual object GetStreamVersion (string streamName)
  89. {
  90. return host.GetStreamVersion (streamName);
  91. }
  92. public virtual IDisposable Impersonate ()
  93. {
  94. return host.Impersonate ();
  95. }
  96. public virtual void Init (IInternalConfigRoot root, params object[] hostInitParams)
  97. {
  98. host.Init (root, hostInitParams);
  99. }
  100. public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams)
  101. {
  102. host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, root, hostInitConfigurationParams);
  103. }
  104. public virtual bool IsAboveApplication (string configPath)
  105. {
  106. return host.IsAboveApplication (configPath);
  107. }
  108. public virtual bool IsConfigRecordRequired (string configPath)
  109. {
  110. return host.IsConfigRecordRequired (configPath);
  111. }
  112. public virtual bool IsDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition)
  113. {
  114. return host.IsDefinitionAllowed (configPath, allowDefinition, allowExeDefinition);
  115. }
  116. public virtual bool IsFile (string streamName)
  117. {
  118. return host.IsFile (streamName);
  119. }
  120. public virtual bool IsLocationApplicable (string configPath)
  121. {
  122. return host.IsLocationApplicable (configPath);
  123. }
  124. public virtual Stream OpenStreamForRead (string streamName)
  125. {
  126. return host.OpenStreamForRead (streamName);
  127. }
  128. public virtual Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext)
  129. {
  130. return host.OpenStreamForWrite (streamName, templateStreamName, ref writeContext);
  131. }
  132. public virtual bool PrefetchAll (string configPath, string streamName)
  133. {
  134. return host.PrefetchAll (configPath, streamName);
  135. }
  136. public virtual bool PrefetchSection (string sectionGroupName, string sectionName)
  137. {
  138. return host.PrefetchSection (sectionGroupName, sectionName);
  139. }
  140. public virtual object StartMonitoringStreamForChanges (string streamName, StreamChangeCallback callback)
  141. {
  142. return host.StartMonitoringStreamForChanges (streamName, callback);
  143. }
  144. public virtual void StopMonitoringStreamForChanges (string streamName, StreamChangeCallback callback)
  145. {
  146. host.StopMonitoringStreamForChanges (streamName, callback);
  147. }
  148. public virtual void VerifyDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition, IConfigErrorInfo errorInfo)
  149. {
  150. host.VerifyDefinitionAllowed (configPath, allowDefinition, allowExeDefinition, errorInfo);
  151. }
  152. public virtual void WriteCompleted (string streamName, bool success, object writeContext)
  153. {
  154. host.WriteCompleted (streamName, success, writeContext);
  155. }
  156. public virtual bool SupportsChangeNotifications {
  157. get { return host.SupportsChangeNotifications; }
  158. }
  159. public virtual bool SupportsLocation {
  160. get { return host.SupportsLocation; }
  161. }
  162. public virtual bool SupportsPath {
  163. get { return host.SupportsPath; }
  164. }
  165. public virtual bool SupportsRefresh {
  166. get { return host.SupportsRefresh; }
  167. }
  168. }
  169. }
  170. #endif