(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / corlib / System / AppDomainSetup.cs
blob4347032808c9666d36befbbad182202c9aeb26b0
1 //
2 // System.AppDomainSetup.cs
3 //
4 // Author:
5 // Dietmar Maurer (dietmar@ximian.com)
6 //
7 // (C) 2001 Ximian, Inc. http://www.ximian.com
8 //
11 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
13 // Permission is hereby granted, free of charge, to any person obtaining
14 // a copy of this software and associated documentation files (the
15 // "Software"), to deal in the Software without restriction, including
16 // without limitation the rights to use, copy, modify, merge, publish,
17 // distribute, sublicense, and/or sell copies of the Software, and to
18 // permit persons to whom the Software is furnished to do so, subject to
19 // the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be
22 // included in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 using System.IO;
34 using System.Runtime.CompilerServices;
35 using System.Runtime.InteropServices;
37 namespace System
39 [Serializable]
40 [ClassInterface (ClassInterfaceType.None)]
41 [MonoTODO ("Fix serialization compatibility with MS.NET")]
42 public sealed class AppDomainSetup : IAppDomainSetup
44 string application_base;
45 string application_name;
46 string cache_path;
47 string configuration_file;
48 string dynamic_base;
49 string license_file;
50 string private_bin_path;
51 string private_bin_path_probe;
52 string shadow_copy_directories;
53 string shadow_copy_files;
54 bool publisher_policy;
55 private bool path_changed;
56 private LoaderOptimization loader_optimization;
57 bool disallow_binding_redirects;
58 bool disallow_code_downloads;
60 public AppDomainSetup ()
64 internal AppDomainSetup (AppDomainSetup setup)
66 application_base = setup.application_base;
67 application_name = setup.application_name;
68 cache_path = setup.cache_path;
69 configuration_file = setup.configuration_file;
70 dynamic_base = setup.dynamic_base;
71 license_file = setup.license_file;
72 private_bin_path = setup.private_bin_path;
73 private_bin_path_probe = setup.private_bin_path_probe;
74 shadow_copy_directories = setup.shadow_copy_directories;
75 shadow_copy_files = setup.shadow_copy_files;
76 publisher_policy = setup.publisher_policy;
77 path_changed = setup.path_changed;
78 loader_optimization = setup.loader_optimization;
79 disallow_binding_redirects = setup.disallow_binding_redirects;
80 disallow_code_downloads = setup.disallow_code_downloads;
83 static string GetAppBase (string appBase)
85 if (appBase == null) return null;
86 int len = appBase.Length;
87 if (len >= 8 && appBase.ToLower ().StartsWith ("file://")) {
88 appBase = appBase.Substring (7);
89 if (Path.DirectorySeparatorChar != '/')
90 appBase = appBase.Replace ('/', Path.DirectorySeparatorChar);
92 } else if (appBase.IndexOf (':') == -1) {
93 appBase = Path.GetFullPath (appBase);
96 return appBase;
99 public string ApplicationBase {
100 get {
101 return application_base;
103 set {
104 application_base = GetAppBase (value);
108 public string ApplicationName {
109 get {
110 return application_name;
112 set {
113 application_name = value;
117 public string CachePath {
118 get {
119 return cache_path;
121 set {
122 cache_path = value;
126 public string ConfigurationFile {
127 get {
128 return configuration_file;
130 set {
131 configuration_file = value;
135 public bool DisallowPublisherPolicy {
136 get {
137 return publisher_policy;
139 set {
140 publisher_policy = value;
144 public string DynamicBase {
145 get {
146 if (dynamic_base == null)
147 return null;
149 if (Path.IsPathRooted (dynamic_base))
150 return dynamic_base;
152 if (ApplicationBase == null)
153 throw new MemberAccessException ("The ApplicationBase must be set before retrieving this property.");
155 return Path.Combine (ApplicationBase, dynamic_base);
157 set {
158 if (application_name == null)
159 throw new MemberAccessException ("ApplicationName must be set before the DynamicBase can be set.");
160 uint id = (uint) application_name.GetHashCode ();
161 dynamic_base = Path.Combine (value, id.ToString("x"));
165 public string LicenseFile {
166 get {
167 return license_file;
169 set {
170 license_file = value;
174 [MonoTODO ("--share-code")]
175 public LoaderOptimization LoaderOptimization {
176 get {
177 return loader_optimization;
179 set {
180 loader_optimization = value;
184 public string PrivateBinPath {
185 get {
186 return private_bin_path;
188 set {
189 private_bin_path = value;
190 path_changed = true;
194 public string PrivateBinPathProbe {
195 get {
196 return private_bin_path_probe;
198 set {
199 private_bin_path_probe = value;
200 path_changed = true;
204 public string ShadowCopyDirectories {
205 get {
206 return shadow_copy_directories;
208 set {
209 shadow_copy_directories = value;
213 public string ShadowCopyFiles {
214 get {
215 return shadow_copy_files;
217 set {
218 shadow_copy_files = value;
222 #if NET_1_1
223 public bool DisallowBindingRedirects {
224 get {
225 return disallow_binding_redirects;
227 set {
228 disallow_binding_redirects = value;
232 public bool DisallowCodeDownload {
233 get {
234 return disallow_code_downloads;
236 set {
237 disallow_code_downloads = value;
240 #endif