New test.
[mono.git] / mcs / class / System.Configuration / System.Configuration.Internal / DelegatingConfigHost.cs
1 //
2 // System.Configuration.Internal.IConfigErrorInfo.cs
3 //
4 // Authors:
5 //  Lluis Sanchez Gual (lluis@novell.com)
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
29 #if NET_2_0
30
31 using System;
32 using System.IO;
33 using System.Security;
34
35 namespace System.Configuration.Internal
36 {
37         public class DelegatingConfigHost: IInternalConfigHost
38         {
39                 IInternalConfigHost host;
40                 
41                 protected DelegatingConfigHost ()
42                 {
43                 }
44                 
45                 protected IInternalConfigHost Host {
46                         get { return host; }
47                         set { host = value; }
48                 }
49                 
50                 public virtual object CreateConfigurationContext (string configPath, string locationSubPath)
51                 {
52                         return host.CreateConfigurationContext (configPath, locationSubPath);
53                 }
54                 
55                 public virtual object CreateDeprecatedConfigContext (string configPath)
56                 {
57                         return host.CreateDeprecatedConfigContext (configPath);
58                 }
59                 
60                 public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
61                 {
62                         return host.DecryptSection (encryptedXml, protectionProvider, protectedSection);
63                 }
64                 
65                 public virtual void DeleteStream (string streamName)
66                 {
67                         host.DeleteStream (streamName);
68                 }
69                 
70                 public virtual string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
71                 {
72                         return host.EncryptSection (encryptedXml, protectionProvider, protectedSection);
73                 }
74                 
75                 public virtual string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath)
76                 {
77                         return host.GetConfigPathFromLocationSubPath (configPath, locatinSubPath);
78                 }
79                 
80                 public virtual Type GetConfigType (string typeName, bool throwOnError)
81                 {
82                         return host.GetConfigType (typeName, throwOnError);
83                 }
84                 
85                 public virtual string GetConfigTypeName (Type t)
86                 {
87                         return host.GetConfigTypeName (t);
88                 }
89                 
90                 public virtual void GetRestrictedPermissions (IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady)
91                 {
92                         host.GetRestrictedPermissions (configRecord, out permissionSet, out isHostReady);
93                 }
94                 
95                 public virtual string GetStreamName (string configPath)
96                 {
97                         return host.GetStreamName (configPath);
98                 }
99                 
100                 public virtual string GetStreamNameForConfigSource (string streamName, string configSource)
101                 {
102                         return host.GetStreamNameForConfigSource (streamName, configSource);
103                 }
104                 
105                 public virtual object GetStreamVersion (string streamName)
106                 {
107                         return host.GetStreamVersion (streamName);
108                 }
109                 
110                 public virtual IDisposable Impersonate ()
111                 {
112                         return host.Impersonate ();
113                 }
114                 
115                 public virtual void Init (IInternalConfigRoot root, params object[] hostInitParams)
116                 {
117                         host.Init (root, hostInitParams);
118                 }
119                 
120                 public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams)
121                 {
122                         host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, root, hostInitConfigurationParams);
123                 }
124                 
125                 public virtual bool IsAboveApplication (string configPath)
126                 {
127                         return host.IsAboveApplication (configPath);
128                 }
129                 
130                 public virtual bool IsConfigRecordRequired (string configPath)
131                 {
132                         return host.IsConfigRecordRequired (configPath);
133                 }
134                 
135                 public virtual bool IsDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition)
136                 {
137                         return host.IsDefinitionAllowed (configPath, allowDefinition, allowExeDefinition);
138                 }
139
140                 public virtual bool IsInitDelayed (IInternalConfigRecord configRecord)
141                 {
142                         return host.IsInitDelayed (configRecord);
143                 }
144                 
145                 public virtual bool IsFile (string streamName)
146                 {
147                         return host.IsFile (streamName);
148                 }
149                 
150                 public bool IsFullTrustSectionWithoutAptcaAllowed (IInternalConfigRecord configRecord)
151                 {
152                         return host.IsFullTrustSectionWithoutAptcaAllowed (configRecord);
153                 }
154
155                 public virtual bool IsLocationApplicable (string configPath)
156                 {
157                         return host.IsLocationApplicable (configPath);
158                 }
159
160                 public bool IsRemote {
161                         get { return host.IsRemote; }
162                 }
163
164                 public bool IsSecondaryRoot (string configPath)
165                 {
166                         return host.IsSecondaryRoot (configPath);
167                 }
168
169                 public bool IsTrustedConfigPath (string configPath)
170                 {
171                         return host.IsTrustedConfigPath (configPath);
172                 }
173                 
174                 public virtual Stream OpenStreamForRead (string streamName)
175                 {
176                         return host.OpenStreamForRead (streamName);
177                 }
178
179                 public Stream OpenStreamForRead (string streamName, bool assertPermissions)
180                 {
181                         return host.OpenStreamForRead (streamName, assertPermissions);
182                 }
183                 
184                 public virtual Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext)
185                 {
186                         return host.OpenStreamForWrite (streamName, templateStreamName, ref writeContext);
187                 }
188                 
189                 public Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext, bool assertPermissions)
190                 {
191                         return host.OpenStreamForWrite (streamName, templateStreamName, ref writeContext, assertPermissions);
192                 }
193
194                 public virtual bool PrefetchAll (string configPath, string streamName)
195                 {
196                         return host.PrefetchAll (configPath, streamName);
197                 }
198                 
199                 public virtual bool PrefetchSection (string sectionGroupName, string sectionName)
200                 {
201                         return host.PrefetchSection (sectionGroupName, sectionName);
202                 }
203
204                 public virtual void RequireCompleteInit (IInternalConfigRecord configRecord)
205                 {
206                         host.RequireCompleteInit (configRecord);
207                 }
208                 
209                 public virtual object StartMonitoringStreamForChanges (string streamName, StreamChangeCallback callback)
210                 {
211                         return host.StartMonitoringStreamForChanges (streamName, callback);
212                 }
213                 
214                 public virtual void StopMonitoringStreamForChanges (string streamName, StreamChangeCallback callback)
215                 {
216                         host.StopMonitoringStreamForChanges (streamName, callback);
217                 }
218                 
219                 public virtual void VerifyDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition, IConfigErrorInfo errorInfo)
220                 {
221                         host.VerifyDefinitionAllowed (configPath, allowDefinition, allowExeDefinition, errorInfo);
222                 }
223                 
224                 public virtual void WriteCompleted (string streamName, bool success, object writeContext)
225                 {
226                         host.WriteCompleted (streamName, success, writeContext);
227                 }
228                 
229                 public void WriteCompleted (string streamName, bool success, object writeContext, bool assertPermissions)
230                 {
231                         host.WriteCompleted (streamName, success, writeContext, assertPermissions);
232                 }
233                 
234                 public virtual bool SupportsChangeNotifications {
235                         get { return host.SupportsChangeNotifications; }
236                 }
237                 
238                 public virtual bool SupportsLocation {
239                         get { return host.SupportsLocation; }
240                 }
241                 
242                 public virtual bool SupportsPath {
243                         get { return host.SupportsPath; }
244                 }
245                 
246                 public virtual bool SupportsRefresh {
247                         get { return host.SupportsRefresh; }
248                 }
249         }
250 }
251
252 #endif