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