/// <summary>从 XML 编码重新构造具有指定状态的权限。</summary>
 /// <param name="securityElement">
 /// <see cref="T:System.Security.SecurityElement" />,包含用于重新构造权限的 XML 编码。</param>
 /// <exception cref="T:System.ArgumentNullException">
 /// <paramref name="securityElement" /> 为 null。</exception>
 /// <exception cref="T:System.ArgumentException">
 /// <paramref name="securityElement" /> 不是一个有效的权限元素。- 或 -不支持 <paramref name="securityElement" /> 的版本号。</exception>
 public override void FromXml(SecurityElement securityElement)
 {
     CodeAccessPermission.ValidateElement(securityElement, (IPermission)this);
     if (XMLUtil.IsUnrestricted(securityElement))
     {
         this.m_flags         = KeyContainerPermissionFlags.AllFlags;
         this.m_accessEntries = new KeyContainerPermissionAccessEntryCollection(this.m_flags);
     }
     else
     {
         this.m_flags = KeyContainerPermissionFlags.NoFlags;
         string str = securityElement.Attribute("Flags");
         if (str != null)
         {
             KeyContainerPermissionFlags flags = (KeyContainerPermissionFlags)Enum.Parse(typeof(KeyContainerPermissionFlags), str);
             KeyContainerPermission.VerifyFlags(flags);
             this.m_flags = flags;
         }
         this.m_accessEntries = new KeyContainerPermissionAccessEntryCollection(this.m_flags);
         if (securityElement.InternalChildren == null || securityElement.InternalChildren.Count == 0)
         {
             return;
         }
         foreach (SecurityElement child in securityElement.Children)
         {
             if (child != null && string.Equals(child.Tag, "AccessList"))
             {
                 this.AddAccessEntries(child);
             }
         }
     }
 }
        /// <summary>Reconstructs a permission with a specified state from an XML encoding.</summary>
        /// <param name="securityElement">A <see cref="T:System.Security.SecurityElement" /> that contains the XML encoding used to reconstruct the permission. </param>
        /// <exception cref="T:System.ArgumentNullException">
        ///         <paramref name="securityElement" /> is <see langword="null" />. </exception>
        /// <exception cref="T:System.ArgumentException">
        ///         <paramref name="securityElement" /> is not a valid permission element.-or- The version number of <paramref name="securityElement" /> is not supported. </exception>
        // Token: 0x060026CA RID: 9930 RVA: 0x0008C94C File Offset: 0x0008AB4C
        public override void FromXml(SecurityElement securityElement)
        {
            CodeAccessPermission.ValidateElement(securityElement, this);
            if (XMLUtil.IsUnrestricted(securityElement))
            {
                this.m_flags         = KeyContainerPermissionFlags.AllFlags;
                this.m_accessEntries = new KeyContainerPermissionAccessEntryCollection(this.m_flags);
                return;
            }
            this.m_flags = KeyContainerPermissionFlags.NoFlags;
            string text = securityElement.Attribute("Flags");

            if (text != null)
            {
                KeyContainerPermissionFlags flags = (KeyContainerPermissionFlags)Enum.Parse(typeof(KeyContainerPermissionFlags), text);
                KeyContainerPermission.VerifyFlags(flags);
                this.m_flags = flags;
            }
            this.m_accessEntries = new KeyContainerPermissionAccessEntryCollection(this.m_flags);
            if (securityElement.InternalChildren != null && securityElement.InternalChildren.Count != 0)
            {
                foreach (object obj in securityElement.Children)
                {
                    SecurityElement securityElement2 = (SecurityElement)obj;
                    if (securityElement2 != null && string.Equals(securityElement2.Tag, "AccessList"))
                    {
                        this.AddAccessEntries(securityElement2);
                    }
                }
            }
        }
 /// <summary>用指定的全局访问和特定的密钥容器访问权限来初始化 <see cref="T:System.Security.Permissions.KeyContainerPermission" /> 类的新实例。</summary>
 /// <param name="flags">
 /// <see cref="T:System.Security.Permissions.KeyContainerPermissionFlags" /> 值的按位组合。</param>
 /// <param name="accessList">
 /// <see cref="T:System.Security.Permissions.KeyContainerPermissionAccessEntry" /> 对象数组,标识特定的密钥容器访问权限。</param>
 /// <exception cref="T:System.ArgumentException">
 /// <paramref name="flags" /> 不是 <see cref="T:System.Security.Permissions.KeyContainerPermissionFlags" /> 值的有效组合。</exception>
 /// <exception cref="T:System.ArgumentNullException">
 /// <paramref name="accessList" /> 为 null。</exception>
 public KeyContainerPermission(KeyContainerPermissionFlags flags, KeyContainerPermissionAccessEntry[] accessList)
 {
     if (accessList == null)
     {
         throw new ArgumentNullException("accessList");
     }
     KeyContainerPermission.VerifyFlags(flags);
     this.m_flags         = flags;
     this.m_accessEntries = new KeyContainerPermissionAccessEntryCollection(this.m_flags);
     for (int index = 0; index < accessList.Length; ++index)
     {
         this.m_accessEntries.Add(accessList[index]);
     }
 }
 /// <summary>用指定的访问权限初始化 <see cref="T:System.Security.Permissions.KeyContainerPermission" /> 类的新实例。</summary>
 /// <param name="flags">
 /// <see cref="T:System.Security.Permissions.KeyContainerPermissionFlags" /> 值的按位组合。</param>
 /// <exception cref="T:System.ArgumentException">
 /// <paramref name="flags" /> 不是 <see cref="T:System.Security.Permissions.KeyContainerPermissionFlags" /> 值的有效组合。</exception>
 public KeyContainerPermission(KeyContainerPermissionFlags flags)
 {
     KeyContainerPermission.VerifyFlags(flags);
     this.m_flags         = flags;
     this.m_accessEntries = new KeyContainerPermissionAccessEntryCollection(this.m_flags);
 }