[runtime] Fix Empty generic enumerator equality
[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 #if !FULL_AOT_RUNTIME
35 using System.Reflection.Emit;
36 #endif
37 using System.Globalization;
38 using System.Runtime.Remoting;
39 using System.Runtime.InteropServices;
40
41 namespace System
42 {
43         [ComVisible (true)]
44         [CLSCompliant (false)]
45         [InterfaceType (ComInterfaceType.InterfaceIsIUnknown)]
46         [Guid ("05F696DC-2B29-3663-AD8B-C4389CF2A713")]
47         public interface _AppDomain
48         {
49                 string BaseDirectory {get; }
50                 string DynamicDirectory {get; }
51                 Evidence Evidence {get; }
52                 string FriendlyName {get; }
53                 string RelativeSearchPath {get; }
54                 bool ShadowCopyFiles {get; }
55
56                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
57                 void AppendPrivatePath (string path);
58
59                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
60                 void ClearPrivatePath ();
61
62                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
63                 void ClearShadowCopyPath ();
64
65                 ObjectHandle CreateInstance (string assemblyName, string typeName);
66                 ObjectHandle CreateInstance (string assemblyName, string typeName, object[] activationAttributes);
67                 ObjectHandle CreateInstance (string assemblyName, string typeName, bool ignoreCase,
68                         BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
69                         object[] activationAttributes, Evidence securityAttributes);
70
71                 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName);
72                 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, object[] activationAttributes);
73                 ObjectHandle CreateInstanceFrom (string assemblyFile, string typeName, bool ignoreCase,
74                         BindingFlags bindingAttr, Binder binder, object[] args, CultureInfo culture,
75                         object[] activationAttributes, Evidence securityAttributes);
76
77 #if !FULL_AOT_RUNTIME
78                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access);
79                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, Evidence evidence);
80                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir);
81                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, Evidence evidence);
82                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
83                         PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
84                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
85                         Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
86                         PermissionSet refusedPermissions);
87                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
88                         string dir, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions);
89                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access,
90                         string dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
91                         PermissionSet refusedPermissions);
92                 AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir,
93                         Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions,
94                         PermissionSet refusedPermissions, bool isSynchronized);
95 #endif
96
97                 void DoCallBack (CrossAppDomainDelegate theDelegate);
98                 bool Equals (object other);
99
100                 int ExecuteAssembly (string assemblyFile);
101                 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity);
102                 int ExecuteAssembly (string assemblyFile, Evidence assemblySecurity, string[] args);
103
104                 Assembly[] GetAssemblies ();
105                 object GetData (string name);
106                 int GetHashCode();
107
108                 object GetLifetimeService ();
109
110                 Type GetType ();
111
112                 [SecurityPermission (SecurityAction.LinkDemand, Infrastructure = true)]
113                 object InitializeLifetimeService ();
114
115                 Assembly Load (AssemblyName assemblyRef);
116                 Assembly Load (byte[] rawAssembly);
117                 Assembly Load (string assemblyString);
118                 Assembly Load (AssemblyName assemblyRef, Evidence assemblySecurity);
119                 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore);
120                 Assembly Load (string assemblyString, Evidence assemblySecurity);
121                 Assembly Load (byte[] rawAssembly, byte[] rawSymbolStore, Evidence securityEvidence);
122
123                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
124                 void SetAppDomainPolicy (PolicyLevel domainPolicy);
125
126                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
127                 void SetCachePath (string s);
128
129                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
130                 void SetData (string name, object data);
131
132                 void SetPrincipalPolicy (PrincipalPolicy policy);
133
134                 [SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
135                 void SetShadowCopyPath (string s);
136
137                 void SetThreadPrincipal (IPrincipal principal);
138
139                 string ToString ();
140
141                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
142                 event AssemblyLoadEventHandler AssemblyLoad;
143
144                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
145                 event ResolveEventHandler AssemblyResolve;
146
147                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
148                 event EventHandler DomainUnload;
149
150                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
151                 event EventHandler ProcessExit;
152
153                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
154                 event ResolveEventHandler ResourceResolve;
155
156                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
157                 event ResolveEventHandler TypeResolve;
158
159                 [method: SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
160                 event UnhandledExceptionEventHandler UnhandledException;
161
162 #if !MOBILE
163                 void GetIDsOfNames ([In] ref Guid riid, IntPtr rgszNames, uint cNames, uint lcid, IntPtr rgDispId);
164
165                 void GetTypeInfo (uint iTInfo, uint lcid, IntPtr ppTInfo);
166
167                 void GetTypeInfoCount (out uint pcTInfo);
168
169                 void Invoke (uint dispIdMember, [In] ref Guid riid, uint lcid, short wFlags, IntPtr pDispParams,
170                         IntPtr pVarResult, IntPtr pExcepInfo, IntPtr puArgErr);
171 #endif
172         }
173 }