using System; using System.Runtime.InteropServices; namespace System.Security.Permissions { /// Allows the use of declarative security actions to determine host protection requirements. This class cannot be inherited. // Token: 0x02000549 RID: 1353 [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Delegate, AllowMultiple = true, Inherited = false)] [ComVisible(true)] [Serializable] public sealed class HostProtectionAttribute : CodeAccessSecurityAttribute { /// Initializes a new instance of the class with default values. // Token: 0x0600318A RID: 12682 RVA: 0x000AA7A8 File Offset: 0x000A89A8 public HostProtectionAttribute() : base(SecurityAction.LinkDemand) { } /// Initializes a new instance of the class with the specified value. /// One of the values. /// /// is not . // Token: 0x0600318B RID: 12683 RVA: 0x000AA7B4 File Offset: 0x000A89B4 public HostProtectionAttribute(SecurityAction action) : base(action) { if (action != SecurityAction.LinkDemand) { string text = string.Format(Locale.GetText("Only {0} is accepted."), SecurityAction.LinkDemand); throw new ArgumentException(text, "action"); } } /// Gets or sets a value indicating whether external process management is exposed. /// true if external process management is exposed; otherwise, false. The default is false. // Token: 0x170009AF RID: 2479 // (get) Token: 0x0600318C RID: 12684 RVA: 0x000AA7F4 File Offset: 0x000A89F4 // (set) Token: 0x0600318D RID: 12685 RVA: 0x000AA804 File Offset: 0x000A8A04 public bool ExternalProcessMgmt { get { return (this._resources & HostProtectionResource.ExternalProcessMgmt) != HostProtectionResource.None; } set { if (value) { this._resources |= HostProtectionResource.ExternalProcessMgmt; } else { this._resources &= ~HostProtectionResource.ExternalProcessMgmt; } } } /// Gets or sets a value indicating whether external threading is exposed. /// true if external threading is exposed; otherwise, false. The default is false. // Token: 0x170009B0 RID: 2480 // (get) Token: 0x0600318E RID: 12686 RVA: 0x000AA83C File Offset: 0x000A8A3C // (set) Token: 0x0600318F RID: 12687 RVA: 0x000AA850 File Offset: 0x000A8A50 public bool ExternalThreading { get { return (this._resources & HostProtectionResource.ExternalThreading) != HostProtectionResource.None; } set { if (value) { this._resources |= HostProtectionResource.ExternalThreading; } else { this._resources &= ~HostProtectionResource.ExternalThreading; } } } /// Gets or sets a value indicating whether resources might leak memory if the operation is terminated. /// true if resources might leak memory on termination; otherwise, false. // Token: 0x170009B1 RID: 2481 // (get) Token: 0x06003190 RID: 12688 RVA: 0x000AA87C File Offset: 0x000A8A7C // (set) Token: 0x06003191 RID: 12689 RVA: 0x000AA890 File Offset: 0x000A8A90 public bool MayLeakOnAbort { get { return (this._resources & HostProtectionResource.MayLeakOnAbort) != HostProtectionResource.None; } set { if (value) { this._resources |= HostProtectionResource.MayLeakOnAbort; } else { this._resources &= ~HostProtectionResource.MayLeakOnAbort; } } } /// Gets or sets a value indicating whether the security infrastructure is exposed. /// true if the security infrastructure is exposed; otherwise, false. The default is false. // Token: 0x170009B2 RID: 2482 // (get) Token: 0x06003192 RID: 12690 RVA: 0x000AA8C4 File Offset: 0x000A8AC4 // (set) Token: 0x06003193 RID: 12691 RVA: 0x000AA8D8 File Offset: 0x000A8AD8 [ComVisible(true)] public bool SecurityInfrastructure { get { return (this._resources & HostProtectionResource.SecurityInfrastructure) != HostProtectionResource.None; } set { if (value) { this._resources |= HostProtectionResource.SecurityInfrastructure; } else { this._resources &= ~HostProtectionResource.SecurityInfrastructure; } } } /// Gets or sets a value indicating whether self-affecting process management is exposed. /// true if self-affecting process management is exposed; otherwise, false. The default is false. // Token: 0x170009B3 RID: 2483 // (get) Token: 0x06003194 RID: 12692 RVA: 0x000AA904 File Offset: 0x000A8B04 // (set) Token: 0x06003195 RID: 12693 RVA: 0x000AA914 File Offset: 0x000A8B14 public bool SelfAffectingProcessMgmt { get { return (this._resources & HostProtectionResource.SelfAffectingProcessMgmt) != HostProtectionResource.None; } set { if (value) { this._resources |= HostProtectionResource.SelfAffectingProcessMgmt; } else { this._resources &= ~HostProtectionResource.SelfAffectingProcessMgmt; } } } /// Gets or sets a value indicating whether self-affecting threading is exposed. /// true if self-affecting threading is exposed; otherwise, false. The default is false. // Token: 0x170009B4 RID: 2484 // (get) Token: 0x06003196 RID: 12694 RVA: 0x000AA94C File Offset: 0x000A8B4C // (set) Token: 0x06003197 RID: 12695 RVA: 0x000AA960 File Offset: 0x000A8B60 public bool SelfAffectingThreading { get { return (this._resources & HostProtectionResource.SelfAffectingThreading) != HostProtectionResource.None; } set { if (value) { this._resources |= HostProtectionResource.SelfAffectingThreading; } else { this._resources &= ~HostProtectionResource.SelfAffectingThreading; } } } /// Gets or sets a value indicating whether shared state is exposed. /// true if shared state is exposed; otherwise, false. The default is false. // Token: 0x170009B5 RID: 2485 // (get) Token: 0x06003198 RID: 12696 RVA: 0x000AA98C File Offset: 0x000A8B8C // (set) Token: 0x06003199 RID: 12697 RVA: 0x000AA99C File Offset: 0x000A8B9C public bool SharedState { get { return (this._resources & HostProtectionResource.SharedState) != HostProtectionResource.None; } set { if (value) { this._resources |= HostProtectionResource.SharedState; } else { this._resources &= ~HostProtectionResource.SharedState; } } } /// Gets or sets a value indicating whether synchronization is exposed. /// true if synchronization is exposed; otherwise, false. The default is false. // Token: 0x170009B6 RID: 2486 // (get) Token: 0x0600319A RID: 12698 RVA: 0x000AA9D4 File Offset: 0x000A8BD4 // (set) Token: 0x0600319B RID: 12699 RVA: 0x000AA9E4 File Offset: 0x000A8BE4 public bool Synchronization { get { return (this._resources & HostProtectionResource.Synchronization) != HostProtectionResource.None; } set { if (value) { this._resources |= HostProtectionResource.Synchronization; } else { this._resources &= ~HostProtectionResource.Synchronization; } } } /// Gets or sets a value indicating whether the user interface is exposed. /// true if the user interface is exposed; otherwise, false. The default is false. // Token: 0x170009B7 RID: 2487 // (get) Token: 0x0600319C RID: 12700 RVA: 0x000AAA1C File Offset: 0x000A8C1C // (set) Token: 0x0600319D RID: 12701 RVA: 0x000AAA30 File Offset: 0x000A8C30 public bool UI { get { return (this._resources & HostProtectionResource.UI) != HostProtectionResource.None; } set { if (value) { this._resources |= HostProtectionResource.UI; } else { this._resources &= ~HostProtectionResource.UI; } } } /// Gets or sets flags specifying categories of functionality that are potentially harmful to the host. /// A bitwise combination of the values. The default is . // Token: 0x170009B8 RID: 2488 // (get) Token: 0x0600319E RID: 12702 RVA: 0x000AAA64 File Offset: 0x000A8C64 // (set) Token: 0x0600319F RID: 12703 RVA: 0x000AAA6C File Offset: 0x000A8C6C public HostProtectionResource Resources { get { return this._resources; } set { this._resources = value; } } /// Creates and returns a new host protection permission. /// An that corresponds to the current attribute. // Token: 0x060031A0 RID: 12704 RVA: 0x000AAA78 File Offset: 0x000A8C78 public override IPermission CreatePermission() { return null; } // Token: 0x0400143A RID: 5178 private HostProtectionResource _resources; } }