System.Security.Permissions.SecurityPermission.IsUnrestricted C# (CSharp) Method

IsUnrestricted() public method

public IsUnrestricted ( ) : bool
return bool
    public bool IsUnrestricted() { throw null; }
    public override System.Security.SecurityElement ToXml() { throw null; }

Usage Example

Example #1
0
        /// <summary>Creates and returns a permission that is the intersection of the current permission and the specified permission.</summary>
        /// <returns>A new permission object that represents the intersection of the current permission and the specified permission. This new permission is null if the intersection is empty.</returns>
        /// <param name="target">A permission to intersect with the current permission. It must be of the same type as the current permission. </param>
        /// <exception cref="T:System.ArgumentException">The <paramref name="target" /> parameter is not null and is not of the same type as the current permission. </exception>
        public override IPermission Intersect(IPermission target)
        {
            SecurityPermission securityPermission = this.Cast(target);

            if (securityPermission == null)
            {
                return(null);
            }
            if (this.IsEmpty() || securityPermission.IsEmpty())
            {
                return(null);
            }
            if (this.IsUnrestricted() && securityPermission.IsUnrestricted())
            {
                return(new SecurityPermission(PermissionState.Unrestricted));
            }
            if (this.IsUnrestricted())
            {
                return(securityPermission.Copy());
            }
            if (securityPermission.IsUnrestricted())
            {
                return(this.Copy());
            }
            SecurityPermissionFlag securityPermissionFlag = this.flags & securityPermission.flags;

            if (securityPermissionFlag == SecurityPermissionFlag.NoFlags)
            {
                return(null);
            }
            return(new SecurityPermission(securityPermissionFlag));
        }
All Usage Examples Of System.Security.Permissions.SecurityPermission::IsUnrestricted