2004-08-11 Marek Safar <marek.safar@seznam.cz>
authorMarek Safar <marek.safar@gmail.com>
Wed, 11 Aug 2004 17:14:46 +0000 (17:14 -0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 11 Aug 2004 17:14:46 +0000 (17:14 -0000)
* AssemblyBuilder.cs: Added AddPermissionRequests method
used be mcs for SecurityPermissionAttribute handling.

svn path=/trunk/mcs/; revision=32225

mcs/class/corlib/System.Reflection.Emit/AssemblyBuilder.cs
mcs/class/corlib/System.Reflection.Emit/ChangeLog

index c20f62a113b726b5818abd3ecf3262553634b1f7..e53cb2ac24abd55ca82dd8e33b9a3fcee2d64bda 100755 (executable)
@@ -40,6 +40,7 @@ using System.Globalization;
 using System.Runtime.CompilerServices;
 using System.Collections;
 using System.Runtime.InteropServices;
+using System.Security;
 using System.Security.Cryptography;
 using System.Security.Permissions;
 
@@ -109,6 +110,7 @@ namespace System.Reflection.Emit {
                bool created;
                bool is_module_only;
                private Mono.Security.StrongName sn;
+               PermissionSet required_perm, optional_perm, refused_perm;
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                private static extern void basic_init (AssemblyBuilder ab);
@@ -196,6 +198,20 @@ namespace System.Reflection.Emit {
                        resources [p].attrs = attribute;
                }
 
+               /// <summary>
+               /// Don't change the method name and parameters order. It is used by mcs 
+               /// </summary>
+               [MonoTODO ("Missing support in runtime for parameter applying")]
+               internal void AddPermissionRequests (PermissionSet required, PermissionSet optional, PermissionSet refused)
+               {
+                       if (created)
+                               throw new InvalidOperationException ("Assembly was already saved.");
+
+                       required_perm = required;
+                       optional_perm = optional;
+                       refused_perm = refused;
+               }
+
                internal void EmbedResourceFile (string name, string fileName)
                {
                        EmbedResourceFile (name, fileName, ResourceAttributes.Public);
index 08fbbc0347a941a9224e732b31d2545df91894ec..b2b458a066f82f8b92b565ae934e5551bbc94046 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-11  Marek Safar  <marek.safar@seznam.cz>
+
+       * AssemblyBuilder.cs: Added AddPermissionRequests method
+       used be mcs for SecurityPermissionAttribute handling.
+
 2004-08-08  Zoltan Varga  <vargaz@freemail.hu>
 
        * EnumBuilder.cs: Call setup_enum_type () in the constructor. Fixes