private static bool LinkDemandFullTrust (Assembly a)
{
// FullTrust is immutable (and means Unrestricted)
// so we can skip the subset operations and jump to IsUnrestricted.
PermissionSet granted = a.GrantedPermissionSet;
if ((granted != null) && !granted.IsUnrestricted ())
return false;
PermissionSet denied = a.DeniedPermissionSet;
if ((denied != null) && !denied.IsEmpty ())
return false;
return true;
}