using System; using System.Runtime.InteropServices; namespace System.Security.Permissions { /// Allows security actions for to be applied to code using declarative security. // Token: 0x02000562 RID: 1378 [ComVisible(true)] [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = true, Inherited = false)] [Serializable] public sealed class ReflectionPermissionAttribute : CodeAccessSecurityAttribute { /// Initializes a new instance of the class with the specified . /// One of the values. // Token: 0x06003258 RID: 12888 RVA: 0x000ACF40 File Offset: 0x000AB140 public ReflectionPermissionAttribute(SecurityAction action) : base(action) { } /// Gets or sets the current allowed uses of reflection. /// One or more of the values combined using a bitwise OR. /// An attempt is made to set this property to an invalid value. See for the valid values. // Token: 0x170009E2 RID: 2530 // (get) Token: 0x06003259 RID: 12889 RVA: 0x000ACF4C File Offset: 0x000AB14C // (set) Token: 0x0600325A RID: 12890 RVA: 0x000ACF54 File Offset: 0x000AB154 public ReflectionPermissionFlag Flags { get { return this.flags; } set { this.flags = value; this.memberAccess = (this.flags & ReflectionPermissionFlag.MemberAccess) == ReflectionPermissionFlag.MemberAccess; this.reflectionEmit = (this.flags & ReflectionPermissionFlag.ReflectionEmit) == ReflectionPermissionFlag.ReflectionEmit; this.typeInfo = (this.flags & ReflectionPermissionFlag.TypeInformation) == ReflectionPermissionFlag.TypeInformation; } } /// Gets or sets a value that indicates whether invocation of operations on non-public members is allowed. /// true if invocation of operations on non-public members is allowed; otherwise, false. // Token: 0x170009E3 RID: 2531 // (get) Token: 0x0600325B RID: 12891 RVA: 0x000ACF9C File Offset: 0x000AB19C // (set) Token: 0x0600325C RID: 12892 RVA: 0x000ACFA4 File Offset: 0x000AB1A4 public bool MemberAccess { get { return this.memberAccess; } set { if (value) { this.flags |= ReflectionPermissionFlag.MemberAccess; } else { this.flags -= 2; } this.memberAccess = value; } } /// Gets or sets a value that indicates whether use of certain features in , such as emitting debug symbols, is allowed. /// true if use of the affected features is allowed; otherwise, false. // Token: 0x170009E4 RID: 2532 // (get) Token: 0x0600325D RID: 12893 RVA: 0x000ACFE0 File Offset: 0x000AB1E0 // (set) Token: 0x0600325E RID: 12894 RVA: 0x000ACFE8 File Offset: 0x000AB1E8 public bool ReflectionEmit { get { return this.reflectionEmit; } set { if (value) { this.flags |= ReflectionPermissionFlag.ReflectionEmit; } else { this.flags -= 4; } this.reflectionEmit = value; } } /// Gets or sets a value that indicates whether restricted invocation of non-public members is allowed. Restricted invocation means that the grant set of the assembly that contains the non-public member that is being invoked must be equal to, or a subset of, the grant set of the invoking assembly. /// true if restricted invocation of non-public members is allowed; otherwise, false. // Token: 0x170009E5 RID: 2533 // (get) Token: 0x0600325F RID: 12895 RVA: 0x000AD024 File Offset: 0x000AB224 // (set) Token: 0x06003260 RID: 12896 RVA: 0x000AD034 File Offset: 0x000AB234 public bool RestrictedMemberAccess { get { return (this.flags & ReflectionPermissionFlag.RestrictedMemberAccess) == ReflectionPermissionFlag.RestrictedMemberAccess; } set { if (value) { this.flags |= ReflectionPermissionFlag.RestrictedMemberAccess; } else { this.flags -= 8; } } } /// Gets or sets a value that indicates whether reflection on members that are not visible is allowed. /// true if reflection on members that are not visible is allowed; otherwise, false. // Token: 0x170009E6 RID: 2534 // (get) Token: 0x06003261 RID: 12897 RVA: 0x000AD060 File Offset: 0x000AB260 // (set) Token: 0x06003262 RID: 12898 RVA: 0x000AD068 File Offset: 0x000AB268 [Obsolete("not enforced in 2.0+")] public bool TypeInformation { get { return this.typeInfo; } set { if (value) { this.flags |= ReflectionPermissionFlag.TypeInformation; } else { this.flags--; } this.typeInfo = value; } } /// Creates and returns a new . /// A that corresponds to this attribute. // Token: 0x06003263 RID: 12899 RVA: 0x000AD0A4 File Offset: 0x000AB2A4 public override IPermission CreatePermission() { return null; } // Token: 0x040014A5 RID: 5285 private ReflectionPermissionFlag flags; // Token: 0x040014A6 RID: 5286 private bool memberAccess; // Token: 0x040014A7 RID: 5287 private bool reflectionEmit; // Token: 0x040014A8 RID: 5288 private bool typeInfo; } }