diff options
author | Zoltan Varga <vargaz@gmail.com> | 2007-10-19 23:26:37 +0400 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2007-10-19 23:26:37 +0400 |
commit | a5dcd1ea2609d3c6c94a67406d1ebf43efca0485 (patch) | |
tree | 2e120ca5e653a4222ed643eaf97dba119b7d9a46 /mcs/class/corlib/System/AppDomain.cs | |
parent | b951f53c4beaa9e871a08494bf88ddb596c85c73 (diff) |
2007-10-19 Zoltan Varga <vargaz@gmail.com>
* AppDomain.cs: Add NET 3.5 DefineDynamicAssembly () overloads.
svn path=/trunk/mcs/; revision=87844
Diffstat (limited to 'mcs/class/corlib/System/AppDomain.cs')
-rw-r--r-- | mcs/class/corlib/System/AppDomain.cs | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/mcs/class/corlib/System/AppDomain.cs b/mcs/class/corlib/System/AppDomain.cs index 3ff2fbf7c9a..ca85309dfd0 100644 --- a/mcs/class/corlib/System/AppDomain.cs +++ b/mcs/class/corlib/System/AppDomain.cs @@ -51,6 +51,7 @@ using System.Security.Principal; using System.Configuration.Assemblies; #if NET_2_0 +using System.Collections.Generic; using System.Runtime.ConstrainedExecution; #endif @@ -432,6 +433,28 @@ namespace System { return ab; } +#if NET_2_0 + // NET 3.5 method + public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, string dir, + Evidence evidence, + PermissionSet requiredPermissions, + PermissionSet optionalPermissions, + PermissionSet refusedPermissions, bool isSynchronized, IEnumerable<CustomAttributeBuilder> assemblyAttributes) + { + AssemblyBuilder ab = DefineDynamicAssembly (name, access, dir, evidence, requiredPermissions, optionalPermissions, refusedPermissions, isSynchronized); + if (assemblyAttributes != null) + foreach (CustomAttributeBuilder cb in assemblyAttributes) { + ab.SetCustomAttribute (cb); + } + return ab; + } + + // NET 3.5 method + public AssemblyBuilder DefineDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access, IEnumerable<CustomAttributeBuilder> assemblyAttributes) { + return DefineDynamicAssembly (name, access, null, null, null, null, null, false, assemblyAttributes); + } +#endif + internal AssemblyBuilder DefineInternalDynamicAssembly (AssemblyName name, AssemblyBuilderAccess access) { return new AssemblyBuilder (name, null, access, true); @@ -553,7 +576,7 @@ namespace System { { if (rawAssembly == null) throw new ArgumentNullException ("rawAssembly"); - + Assembly assembly = LoadAssemblyRaw (rawAssembly, rawSymbolStore, securityEvidence, refonly); assembly.FromByteArray = true; return assembly; |