using System; using System.Runtime.InteropServices; namespace System.Security.Policy { /// Defines evidence that represents permission requests. This class cannot be inherited. // Token: 0x02000597 RID: 1431 [ComVisible(true)] [Serializable] public sealed class PermissionRequestEvidence : IBuiltInEvidence { /// Initializes a new instance of the class with the permission request of a code assembly. /// The minimum permissions the code requires to run. /// The permissions the code can use if they are granted, but that are not required. /// The permissions the code explicitly asks not to be granted. // Token: 0x06003442 RID: 13378 RVA: 0x000B3AF0 File Offset: 0x000B1CF0 public PermissionRequestEvidence(PermissionSet request, PermissionSet optional, PermissionSet denied) { if (request != null) { this.requested = new PermissionSet(request); } if (optional != null) { this.optional = new PermissionSet(optional); } if (denied != null) { this.denied = new PermissionSet(denied); } } // Token: 0x06003443 RID: 13379 RVA: 0x000B3B3C File Offset: 0x000B1D3C int IBuiltInEvidence.GetRequiredSize(bool verbose) { int num = ((!verbose) ? 1 : 3); if (this.requested != null) { int num2 = this.requested.ToXml().ToString().Length + ((!verbose) ? 0 : 5); num += num2; } if (this.optional != null) { int num3 = this.optional.ToXml().ToString().Length + ((!verbose) ? 0 : 5); num += num3; } if (this.denied != null) { int num4 = this.denied.ToXml().ToString().Length + ((!verbose) ? 0 : 5); num += num4; } return num; } // Token: 0x06003444 RID: 13380 RVA: 0x000B3BF4 File Offset: 0x000B1DF4 [MonoTODO("IBuiltInEvidence")] int IBuiltInEvidence.InitFromBuffer(char[] buffer, int position) { return 0; } // Token: 0x06003445 RID: 13381 RVA: 0x000B3BF8 File Offset: 0x000B1DF8 [MonoTODO("IBuiltInEvidence")] int IBuiltInEvidence.OutputToBuffer(char[] buffer, int position, bool verbose) { return 0; } /// Gets the permissions the code explicitly asks not to be granted. /// The permissions the code explicitly asks not to be granted. // Token: 0x17000A45 RID: 2629 // (get) Token: 0x06003446 RID: 13382 RVA: 0x000B3BFC File Offset: 0x000B1DFC public PermissionSet DeniedPermissions { get { return this.denied; } } /// Gets the permissions the code can use if they are granted, but are not required. /// The permissions the code can use if they are granted, but are not required. // Token: 0x17000A46 RID: 2630 // (get) Token: 0x06003447 RID: 13383 RVA: 0x000B3C04 File Offset: 0x000B1E04 public PermissionSet OptionalPermissions { get { return this.optional; } } /// Gets the minimum permissions the code requires to run. /// The minimum permissions the code requires to run. // Token: 0x17000A47 RID: 2631 // (get) Token: 0x06003448 RID: 13384 RVA: 0x000B3C0C File Offset: 0x000B1E0C public PermissionSet RequestedPermissions { get { return this.requested; } } /// Creates an equivalent copy of the current . /// An equivalent copy of the current . // Token: 0x06003449 RID: 13385 RVA: 0x000B3C14 File Offset: 0x000B1E14 public PermissionRequestEvidence Copy() { return new PermissionRequestEvidence(this.requested, this.optional, this.denied); } /// Gets a string representation of the state of the . /// A representation of the state of the . /// /// /// // Token: 0x0600344A RID: 13386 RVA: 0x000B3C30 File Offset: 0x000B1E30 public override string ToString() { SecurityElement securityElement = new SecurityElement("System.Security.Policy.PermissionRequestEvidence"); securityElement.AddAttribute("version", "1"); if (this.requested != null) { SecurityElement securityElement2 = new SecurityElement("Request"); securityElement2.AddChild(this.requested.ToXml()); securityElement.AddChild(securityElement2); } if (this.optional != null) { SecurityElement securityElement3 = new SecurityElement("Optional"); securityElement3.AddChild(this.optional.ToXml()); securityElement.AddChild(securityElement3); } if (this.denied != null) { SecurityElement securityElement4 = new SecurityElement("Denied"); securityElement4.AddChild(this.denied.ToXml()); securityElement.AddChild(securityElement4); } return securityElement.ToString(); } // Token: 0x0400155E RID: 5470 private PermissionSet requested; // Token: 0x0400155F RID: 5471 private PermissionSet optional; // Token: 0x04001560 RID: 5472 private PermissionSet denied; } }