IsUnrestricted() public method

public IsUnrestricted ( ) : bool
return bool
        /// <devdoc>
        /// <para>Compares two <see cref='System.Net.SocketPermission'/> instances.</para>
        /// </devdoc>
        public override bool IsSubsetOf(IPermission target)
        {
            // Pattern suggested by security engine
            if (target == null)
            {
                return(m_noRestriction == false && m_connectList.Count == 0 && m_acceptList.Count == 0);
            }

            SocketPermission other = target as SocketPermission;

            if (other == null)
            {
                throw new ArgumentException(SR.GetString(SR.net_perm_target), "target");
            }

            if (other.IsUnrestricted())
            {
                return(true);
            }
            else if (this.IsUnrestricted())
            {
                return(false);
            }
            else if (this.m_acceptList.Count + this.m_connectList.Count == 0)
            {
                return(true);
            }
            else if (other.m_acceptList.Count + other.m_connectList.Count == 0)
            {
                return(false);
            }

            bool result = false;

            try {
                if (FindSubset(m_connectList, other.m_connectList) &&
                    FindSubset(m_acceptList, other.m_acceptList))
                {
                    result = true;
                }
            }
            finally {
                //  This is around a back door into DNS
                //  Security engine will call isSubsetOf and probably have
                //  DNS permission asserted. We call DNS resolve.
                //  Before return do cleanup of DNS results.

                //  Only "this" needs cleanup, the policy object is not available for
                //  an application to look at.
                this.CleanupDNS();
            }

            return(result);
        }
        public override bool IsSubsetOf(IPermission target)
        {
            if (target == null)
            {
                return((!this.m_noRestriction && (this.m_connectList.Count == 0)) && (this.m_acceptList.Count == 0));
            }
            SocketPermission permission = target as SocketPermission;

            if (permission == null)
            {
                throw new ArgumentException(SR.GetString("net_perm_target"), "target");
            }
            if (permission.IsUnrestricted())
            {
                return(true);
            }
            if (this.IsUnrestricted())
            {
                return(false);
            }
            if ((this.m_acceptList.Count + this.m_connectList.Count) == 0)
            {
                return(true);
            }
            if ((permission.m_acceptList.Count + permission.m_connectList.Count) == 0)
            {
                return(false);
            }
            bool flag = false;

            try
            {
                if (this.FindSubset(this.m_connectList, permission.m_connectList) && this.FindSubset(this.m_acceptList, permission.m_acceptList))
                {
                    flag = true;
                }
            }
            finally
            {
                this.CleanupDNS();
            }
            return(flag);
        }