Update mcs/class/System.Core/System/TimeZoneInfo.cs
[mono.git] / mcs / class / corlib / System / _AppDomain.cs
1 //
2 // System.AppDomain.cs
3 //
4 // Author:
5 //   Duco Fijma (duco@lorentz.xs4all.nl)
6 //
7 // Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 // 
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 // 
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28
29 using System.Security;
30 using System.Security.Permissions;
31 using System.Security.Policy;
32 using System.Security.Principal;
33 using System.Reflection;
34 using System.Reflection.Emit;
35 using System.Globalization;
36 using System.Runtime.Remoting;
37 using System.Runtime.InteropServices;
38
39 namespace System
40 {
41         [ComVisible (true)]
42         [CLSCompliant (false)]
43         [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
44         [Guid ("05F696DC-2B29-3663-AD8B-C4389CF2A713")]
45         public interface _AppDomain
46         {
47 #if !MOONLIGHT
48                 string BaseDirectory {get; }
49                 string DynamicDirectory {get; }
50                 Evidence Evidence {get; }
51 #endif
52                 string FriendlyName {get; }
53 #if !MOONLIGHT
54                 string RelativeSearchPath {get; }
55                 bool ShadowCopyFiles {get; }
56
57                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
58                 void AppendPrivatePath (string path);
59
60                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
61                 void ClearPrivatePath ();
62
63                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
64                 void ClearShadowCopyPath ();
65 #endif
66
67 #if !MOONLIGHT
68                 ObjectHandle CreateInstance (string assemblyName, string typeName);
69                 ObjectHandle CreateInstance (string assemblyName, string typeName, object[] activationAttributes);
70                 ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
71                         BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
72                         object[] activationAttributes, Evidence securityAttributes);
73
74                 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
75                 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, object[] activationAttributes);
76                 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase,
77                         BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
78                         object[] activationAttributes, Evidence securityAttributes);
79 #endif
80                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access);
81                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence);
82                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir);
83                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence);
84                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
85                         PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
86                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
87                         Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
88                         PermissionSet refusedPermissions);
89                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
90                         string dir, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
91                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
92                         string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
93                         PermissionSet refusedPermissions);
94                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
95                         Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
96                         PermissionSet refusedPermissions, bool isSynchronized);
97
98                 void DoCallBack (CrossAppDomainDelegate theDelegate);
99                 bool Equals (object other);
100
101                 int ExecuteAssembly (string assemblyFile);
102                 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
103                 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args);
104
105                 Assembly[] GetAssemblies ();
106                 object GetData (string name);
107                 int GetHashCode();
108
109 #if !NET_4_0
110                 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
111 #endif
112 #if !MOONLIGHT
113                 object GetLifetimeService ();
114 #endif
115
116                 Type GetType ();
117
118 #if !MOONLIGHT
119                 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
120                 object InitializeLifetimeService ();
121 #endif
122
123                 Assembly Load (AssemblyName assemblyRef);
124                 Assembly Load (byte[] rawAssembly);
125                 Assembly Load (string assemblyString);
126                 Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
127                 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
128                 Assembly Load (string assemblyString, Evidence assemblySecurity);
129                 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence);
130
131 #if !MOONLIGHT
132                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
133                 void SetAppDomainPolicy (PolicyLevel domainPolicy);
134
135                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
136                 void SetCachePath (string s);
137 #endif
138
139                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
140                 void SetData (string name, object data);
141
142 #if !MOONLIGHT
143                 void SetPrincipalPolicy (PrincipalPolicy policy);
144
145                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
146                 void SetShadowCopyPath (string s);
147
148                 void SetThreadPrincipal (IPrincipal principal);
149 #endif
150
151                 string ToString ();
152
153                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
154                 event AssemblyLoadEventHandler AssemblyLoad;
155
156                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
157                 event ResolveEventHandler AssemblyResolve;
158
159                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
160                 event EventHandler DomainUnload;
161
162                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
163                 event EventHandler ProcessExit;
164
165                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
166                 event ResolveEventHandler ResourceResolve;
167
168                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
169                 event ResolveEventHandler TypeResolve;
170
171                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
172                 event UnhandledExceptionEventHandler UnhandledException;
173
174 #if !NET_2_1
175                 void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId);
176
177                 void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo);
178
179                 void GetTypeInfoCount (out uint pcTInfo);
180
181                 void Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
182                         IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr);
183 #endif
184         }
185 }