System.Security.Permissions.ResourcePermissionBase.FromXml C# (CSharp) Method

FromXml() public method

public FromXml ( SecurityElement securityElement ) : void
securityElement SecurityElement
return void
        public override void FromXml(SecurityElement securityElement) {
            if (securityElement == null)
                throw new ArgumentNullException("securityElement");
            
            if (!securityElement.Tag.Equals ("Permission") && !securityElement.Tag.Equals ("IPermission"))
                throw new ArgumentException(SR.GetString(SR.Argument_NotAPermissionElement));

            String version = securityElement.Attribute( "version" );
            if (version != null && !version.Equals( "1" ))
                throw new ArgumentException(SR.GetString(SR.Argument_InvalidXMLBadVersion));

            string unrestrictedValue = securityElement.Attribute("Unrestricted");
            if (unrestrictedValue != null && (string.Compare(unrestrictedValue, "true", StringComparison.OrdinalIgnoreCase) == 0)) {
                this.isUnrestricted = true;
                return;
            }
            else
                isUnrestricted = false;
                

            this.rootTable = (Hashtable)ReadChildren(securityElement, 0);
        }