X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2Fcorlib%2FSystem.Security.Permissions%2FReflectionPermissionAttribute.cs;h=8680139527940bf7daa4cf0c78c393e2d766946e;hb=9b4b6d621101fdf06e41b0f76b1ad50b0d1149f2;hp=257894915ac08ebe8c0d1c5f3fe6a39874dc9f91;hpb=f99ce750ee781a2584e849a0264300fa4d99aaaa;p=mono.git diff --git a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs b/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs index 257894915ac..86801395279 100644 --- a/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs +++ b/mcs/class/corlib/System.Security.Permissions/ReflectionPermissionAttribute.cs @@ -33,9 +33,7 @@ using System.Runtime.InteropServices; namespace System.Security.Permissions { -#if NET_2_0 [ComVisible (true)] -#endif [AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple=true, Inherited=false)] @@ -75,6 +73,7 @@ namespace System.Security.Permissions { } } + [Obsolete] public bool ReflectionEmit { get { return reflectionEmit; } @@ -85,11 +84,20 @@ namespace System.Security.Permissions { flags -= ReflectionPermissionFlag.ReflectionEmit; reflectionEmit = value; } - } + } + + public bool RestrictedMemberAccess + { + get { return ((flags & ReflectionPermissionFlag.RestrictedMemberAccess) == ReflectionPermissionFlag.RestrictedMemberAccess); } + set { + if (value) + flags |= ReflectionPermissionFlag.RestrictedMemberAccess; + else + flags -= ReflectionPermissionFlag.RestrictedMemberAccess; + } + } -#if NET_2_0 [Obsolete ("not enforced in 2.0+")] -#endif public bool TypeInformation { get { return typeInfo; } @@ -101,16 +109,20 @@ namespace System.Security.Permissions { typeInfo = value; } } - + // Methods public override IPermission CreatePermission () { +#if MOBILE + return null; +#else ReflectionPermission perm = null; if (this.Unrestricted) perm = new ReflectionPermission (PermissionState.Unrestricted); else perm = new ReflectionPermission (flags); return perm; +#endif } } }