protected override void OnBeforePackageWalk(IPackage package)
{
// Before choosing to uninstall a package we need to figure out if it is in use
IEnumerable<IPackage> dependents = GetDependents(package);
if (dependents.Any())
{
if (Force)
{
// We're going to uninstall this package even though other packages depend on it
_forcedRemoved[package] = dependents;
}
else if (ThrowOnConflicts)
{
// We're not ignoring dependents so raise an error telling the user what the dependents are
throw CreatePackageHasDependentsException(package, dependents);
}
}
}