public IPackageCleanResult CleanProjectPackages(PackageDescriptor packages, IPackageRepository projectRepository, string name, PackageCleanOptions options = PackageCleanOptions.Default)
        {
            if (packages == null) throw new ArgumentNullException("packages");
            if (projectRepository == null) throw new ArgumentNullException("projectRepository");

            var repoForClean = projectRepository as ISupportCleaning;
            if (repoForClean == null) throw new ArgumentException("projectRepository must implement ISupportCleaning");
            return new PackageCleanResultIterator(CleanProjectPackagesCore(packages, repoForClean, x => name.EqualsNoCase(x)));
        }
 public IPackageCleanResult CleanSystemPackages(IPackageRepository systemRepository, string packageName, PackageCleanOptions options = PackageCleanOptions.Default)
 {
     var toClean = systemRepository as ISupportCleaning;
     if (toClean == null) throw new ArgumentException("The repository must implement ISupportCleaning.", "systemRepository");
     return new PackageCleanResultIterator(CleanSystemPackagesCore(toClean, x => packageName.EqualsNoCase(packageName)));
 }
 public IPackageCleanResult CleanSystemPackages(IPackageRepository systemRepository, string packageName, PackageCleanOptions options = PackageCleanOptions.Default)
 {
     if (systemRepository.Feature <ISupportCleaning>() == null)
     {
         throw new ArgumentException("The repository must implement ISupportCleaning.", "systemRepository");
     }
     return(new PackageCleanResultIterator(CleanSystemPackagesCore(systemRepository, x => packageName.EqualsNoCase(packageName))));
 }
        public IPackageCleanResult CleanProjectPackages(IEnumerable <IPackageDescriptor> projectDescriptors, IPackageRepository projectRepository, string name, PackageCleanOptions options = PackageCleanOptions.Default)
        {
            Check.NoNullElements(projectDescriptors, "projectDescriptors");

            if (projectRepository == null)
            {
                throw new ArgumentNullException("projectRepository");
            }

            if (projectRepository.Feature <ISupportCleaning>() == null)
            {
                throw new ArgumentException("projectRepository must implement ISupportCleaning");
            }
            return(new PackageCleanResultIterator(CleanProjectPackagesCore(projectDescriptors, projectRepository, x => name.EqualsNoCase(x))));
        }
        public IPackageCleanResult CleanSystemPackages(IPackageRepository systemRepository, PackageCleanOptions options = PackageCleanOptions.Default)
        {
            var toClean = systemRepository as ISupportCleaning;

            if (toClean == null)
            {
                throw new ArgumentException("The repository must implement ISupportCleaning.", "systemRepository");
            }
            return(new PackageCleanResultIterator(CleanSystemPackagesCore(toClean, x => true)));
        }
        public IPackageCleanResult CleanProjectPackages(IEnumerable <IPackageDescriptor> projectDescriptors, IPackageRepository projectRepository, PackageCleanOptions options = PackageCleanOptions.Default)
        {
            Check.NoNullElements(projectDescriptors, "projectDescriptors");
            if (projectRepository == null)
            {
                throw new ArgumentNullException("Repository");
            }

            var repoForClean = projectRepository as ISupportCleaning;

            if (repoForClean == null)
            {
                throw new ArgumentException("projectRepository must implement ISupportCleaning");
            }
            return(new PackageCleanResultIterator(CleanProjectPackagesCore(projectDescriptors, repoForClean, x => true)));
        }