This commit is contained in:
niko
2026-06-04 11:42:34 +02:00
parent f39ba70a9f
commit e720b98cd1
7488 changed files with 2493818 additions and 0 deletions
@@ -0,0 +1,162 @@
using System;
using System.Runtime.InteropServices;
namespace System.Security.Permissions
{
/// <summary>Allows security actions for <see cref="T:System.Security.Permissions.ReflectionPermission" /> to be applied to code using declarative security. </summary>
// 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
{
/// <summary>Initializes a new instance of the <see cref="T:System.Security.Permissions.ReflectionPermissionAttribute" /> class with the specified <see cref="T:System.Security.Permissions.SecurityAction" />.</summary>
/// <param name="action">One of the <see cref="T:System.Security.Permissions.SecurityAction" /> values. </param>
// Token: 0x06003258 RID: 12888 RVA: 0x000ACF40 File Offset: 0x000AB140
public ReflectionPermissionAttribute(SecurityAction action)
: base(action)
{
}
/// <summary>Gets or sets the current allowed uses of reflection.</summary>
/// <returns>One or more of the <see cref="T:System.Security.Permissions.ReflectionPermissionFlag" /> values combined using a bitwise OR.</returns>
/// <exception cref="T:System.ArgumentException">An attempt is made to set this property to an invalid value. See <see cref="T:System.Security.Permissions.ReflectionPermissionFlag" /> for the valid values. </exception>
// 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;
}
}
/// <summary>Gets or sets a value that indicates whether invocation of operations on non-public members is allowed.</summary>
/// <returns>true if invocation of operations on non-public members is allowed; otherwise, false.</returns>
// 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;
}
}
/// <summary>Gets or sets a value that indicates whether use of certain features in <see cref="N:System.Reflection.Emit" />, such as emitting debug symbols, is allowed.</summary>
/// <returns>true if use of the affected features is allowed; otherwise, false.</returns>
// 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;
}
}
/// <summary>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. </summary>
/// <returns>true if restricted invocation of non-public members is allowed; otherwise, false.</returns>
// 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;
}
}
}
/// <summary>Gets or sets a value that indicates whether reflection on members that are not visible is allowed.</summary>
/// <returns>true if reflection on members that are not visible is allowed; otherwise, false.</returns>
// 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;
}
}
/// <summary>Creates and returns a new <see cref="T:System.Security.Permissions.ReflectionPermission" />.</summary>
/// <returns>A <see cref="T:System.Security.Permissions.ReflectionPermission" /> that corresponds to this attribute.</returns>
// 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;
}
}