2 // System.Configuration.Internal.IInternalConfigHost.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)
32 using System.Security;
34 namespace System.Configuration.Internal
36 [System.Runtime.InteropServices.ComVisible (false)]
37 public interface IInternalConfigHost
39 object CreateConfigurationContext (string configPath, string locationSubPath);
40 object CreateDeprecatedConfigContext (string configPath);
41 string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection);
42 void DeleteStream (string streamName);
43 string EncryptSection (string clearTextXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection);
44 string GetConfigPathFromLocationSubPath (string configPath, string locationSubPath);
45 Type GetConfigType (string typeName, bool throwOnError);
46 string GetConfigTypeName (Type t);
47 void GetRestrictedPermissions (IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady);
48 string GetStreamName (string configPath);
49 string GetStreamNameForConfigSource (string streamName, string configSource);
50 object GetStreamVersion (string streamName);
51 IDisposable Impersonate ();
52 void Init (IInternalConfigRoot configRoot, params object[] hostInitParams);
53 void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot configRoot, params object[] hostInitConfigurationParams);
54 bool IsAboveApplication (string configPath);
55 bool IsConfigRecordRequired (string configPath);
56 bool IsDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition);
57 bool IsFile (string streamName);
58 bool IsFullTrustSectionWithoutAptcaAllowed (IInternalConfigRecord configRecord);
59 bool IsInitDelayed (IInternalConfigRecord configRecord);
60 bool IsLocationApplicable (string configPath);
61 bool IsRemote { get; }
62 bool IsSecondaryRoot (string configPath);
63 bool IsTrustedConfigPath (string configPath);
64 Stream OpenStreamForRead (string streamName);
65 Stream OpenStreamForRead (string streamName, bool assertPermissions);
66 Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext);
67 Stream OpenStreamForWrite (string streamName, string templateStreamName, ref object writeContext, bool assertPermissions);
68 bool PrefetchAll (string configPath, string streamName);
69 bool PrefetchSection (string sectionGroupName, string sectionName);
70 void RequireCompleteInit (IInternalConfigRecord configRecord);
71 object StartMonitoringStreamForChanges (string streamName, StreamChangeCallback callback);
72 void StopMonitoringStreamForChanges (string streamName, StreamChangeCallback callback);
73 void VerifyDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition, IConfigErrorInfo errorInfo);
74 void WriteCompleted (string streamName, bool success, object writeContext);
75 void WriteCompleted (string streamName, bool success, object writeContext, bool assertPermissions);
77 bool SupportsChangeNotifications { get; }
78 bool SupportsLocation { get; }
79 bool SupportsPath { get; }
80 bool SupportsRefresh { get; }