System.Security.Permissions.HostProtectionPermission.Intersect C# (CSharp) Method

Intersect() public method

public Intersect ( IPermission target ) : IPermission
target IPermission
return IPermission
        public override IPermission Intersect(IPermission target)
        {
            if (target == null)
                return null;
            if(this.GetType() != target.GetType())
                throw new ArgumentException( String.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_WrongType"), this.GetType().FullName) );
            HostProtectionResource newResources = (HostProtectionResource)((uint)this.m_resources & (uint)((HostProtectionPermission)target).m_resources);
            if(newResources == HostProtectionResource.None)
                return null;
            return new HostProtectionPermission(newResources);
        }