using System; using System.Security; using System.Security.Permissions; namespace System.Net { /// Specifies permission to access Internet resources. This class cannot be inherited. // Token: 0x0200026C RID: 620 [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = true, Inherited = false)] [Serializable] public sealed class WebPermissionAttribute : CodeAccessSecurityAttribute { /// Initializes a new instance of the class with a value that specifies the security actions that can be performed on this class. /// One of the values. /// /// is not a valid value. // Token: 0x060016E1 RID: 5857 RVA: 0x0004D2CC File Offset: 0x0004B4CC public WebPermissionAttribute(SecurityAction action) : base(action) { } /// Gets or sets the URI string accepted by the current . /// A string containing the URI accepted by the current . /// /// is not null when you attempt to set the value. If you wish to specify more than one Accept URI, use an additional attribute declaration statement. // Token: 0x1700074A RID: 1866 // (get) Token: 0x060016E2 RID: 5858 RVA: 0x0004D2D8 File Offset: 0x0004B4D8 // (set) Token: 0x060016E3 RID: 5859 RVA: 0x0004D2F8 File Offset: 0x0004B4F8 public string Accept { get { if (this.m_accept == null) { return null; } return (this.m_accept as WebPermissionInfo).Info; } set { if (this.m_accept != null) { this.AlreadySet("Accept", "Accept"); } this.m_accept = new WebPermissionInfo(WebPermissionInfoType.InfoString, value); } } /// Gets or sets a regular expression pattern that describes the URI accepted by the current . /// A string containing a regular expression pattern that describes the URI accepted by the current . This string must be escaped according to the rules for encoding a constructor string. /// /// is not null when you attempt to set the value. If you wish to specify more than one Accept URI, use an additional attribute declaration statement. /// /// /// /// // Token: 0x1700074B RID: 1867 // (get) Token: 0x060016E4 RID: 5860 RVA: 0x0004D330 File Offset: 0x0004B530 // (set) Token: 0x060016E5 RID: 5861 RVA: 0x0004D350 File Offset: 0x0004B550 public string AcceptPattern { get { if (this.m_accept == null) { return null; } return (this.m_accept as WebPermissionInfo).Info; } set { if (this.m_accept != null) { this.AlreadySet("Accept", "AcceptPattern"); } if (value == null) { throw new ArgumentNullException("AcceptPattern"); } this.m_accept = new WebPermissionInfo(WebPermissionInfoType.InfoUnexecutedRegex, value); } } /// Gets or sets the URI connection string controlled by the current . /// A string containing the URI connection controlled by the current . /// /// is not null when you attempt to set the value. If you wish to specify more than one Connect URI, use an additional attribute declaration statement. // Token: 0x1700074C RID: 1868 // (get) Token: 0x060016E6 RID: 5862 RVA: 0x0004D38C File Offset: 0x0004B58C // (set) Token: 0x060016E7 RID: 5863 RVA: 0x0004D3AC File Offset: 0x0004B5AC public string Connect { get { if (this.m_connect == null) { return null; } return (this.m_connect as WebPermissionInfo).Info; } set { if (this.m_connect != null) { this.AlreadySet("Connect", "Connect"); } this.m_connect = new WebPermissionInfo(WebPermissionInfoType.InfoString, value); } } /// Gets or sets a regular expression pattern that describes the URI connection controlled by the current . /// A string containing a regular expression pattern that describes the URI connection controlled by this . /// /// is not null when you attempt to set the value. If you wish to specify more than one connect URI, use an additional attribute declaration statement. /// /// /// /// // Token: 0x1700074D RID: 1869 // (get) Token: 0x060016E8 RID: 5864 RVA: 0x0004D3E4 File Offset: 0x0004B5E4 // (set) Token: 0x060016E9 RID: 5865 RVA: 0x0004D404 File Offset: 0x0004B604 public string ConnectPattern { get { if (this.m_connect == null) { return null; } return (this.m_connect as WebPermissionInfo).Info; } set { if (this.m_connect != null) { this.AlreadySet("Connect", "ConnectConnectPattern"); } if (value == null) { throw new ArgumentNullException("ConnectPattern"); } this.m_connect = new WebPermissionInfo(WebPermissionInfoType.InfoUnexecutedRegex, value); } } /// Creates and returns a new instance of the class. /// A corresponding to the security declaration. /// /// /// // Token: 0x060016EA RID: 5866 RVA: 0x0004D440 File Offset: 0x0004B640 public override IPermission CreatePermission() { if (base.Unrestricted) { return new WebPermission(PermissionState.Unrestricted); } WebPermission webPermission = new WebPermission(); if (this.m_accept != null) { webPermission.AddPermission(NetworkAccess.Accept, (WebPermissionInfo)this.m_accept); } if (this.m_connect != null) { webPermission.AddPermission(NetworkAccess.Connect, (WebPermissionInfo)this.m_connect); } return webPermission; } // Token: 0x060016EB RID: 5867 RVA: 0x0004D4A8 File Offset: 0x0004B6A8 internal void AlreadySet(string parameter, string property) { string text = global::Locale.GetText("The parameter '{0}' can be set only once."); throw new ArgumentException(string.Format(text, parameter), property); } // Token: 0x0400127C RID: 4732 private object m_accept; // Token: 0x0400127D RID: 4733 private object m_connect; } }