public override IPermission Intersect(IPermission target) { HostProtectionPermission hostProtectionPermission = this.Cast(target); if (hostProtectionPermission == null) { return(null); } if (this.IsUnrestricted() && hostProtectionPermission.IsUnrestricted()) { return(new HostProtectionPermission(PermissionState.Unrestricted)); } if (this.IsUnrestricted()) { return(hostProtectionPermission.Copy()); } if (hostProtectionPermission.IsUnrestricted()) { return(this.Copy()); } return(new HostProtectionPermission(this._resources & hostProtectionPermission._resources)); }