void CreateUpdatedPackages () { sourceRepository.GetUpdatesAction = (packagesNames, includePrerelease, includeAllVersions, targetFrameworks, versionConstraints) => { includePreleaseUsedWhenCheckingForUpdates = includePrerelease; packageNamesUsedWhenCheckingForUpdates.AddRange (packagesNames.Select (p => (IPackageName)p)); return sourceRepositoryPackages.AsQueryable (); }; updatedPackages = new UpdatedPackages (project, sourceRepository); }
protected override void UpdateRepositoryBeforeReadPackagesTaskStarts() { try { IPackageRepository repository = RegisteredPackageRepositories.ActiveRepository; IQueryable<IPackage> installedPackages = GetInstalledPackages(repository); updatedPackages = new UpdatedPackages(installedPackages, repository); } catch (Exception ex) { errorMessage = ex.Message; } }
protected override void UpdateRepositoryBeforeReadPackagesTaskStarts() { try { IPackageRepository repository = RegisteredPackageRepositories.ActiveRepository; IQueryable <IPackage> installedPackages = GetInstalledPackages(repository); updatedPackages = new UpdatedPackages(installedPackages, repository); } catch (Exception ex) { errorMessage = ex.Message; } }
protected override void UpdateRepositoryBeforeReadPackagesTaskStarts() { try { IPackageRepository aggregateRepository = RegisteredPackageRepositories.CreateAggregateRepository(); IPackageManagementProject project = solution.GetActiveProject(aggregateRepository); updatedPackages = new UpdatedPackages(project, aggregateRepository); } catch (Exception ex) { errorMessage = ex.Message; } }
void CreateUpdatedPackages() { sourceRepository .Stub(repository => repository.GetPackages()) .Return(sourceRepositoryPackages.AsQueryable()); sourceRepository .Stub(repository => repository.GetUpdates( Arg<IEnumerable<IPackage>>.Is.Anything, Arg<bool>.Is.Anything, Arg<bool>.Is.Anything, Arg<IEnumerable<FrameworkName>>.Is.Anything, Arg<IEnumerable<IVersionSpec>>.Is.Anything)) .WhenCalled(call => { includePreleaseUsedWhenCheckingForUpdates = (bool)call.Arguments[1]; packagesUsedWhenCheckingForUpdates.AddRange(call.Arguments[0] as IEnumerable<IPackage>); }) .Return(sourceRepositoryPackages.AsQueryable()); updatedPackages = new UpdatedPackages(installedPackages.AsQueryable(), sourceRepository); }
void CreateUpdatedPackages(IPackageRepository repository) { updatedPackages = new UpdatedPackages(project, repository); }
IQueryable<IPackage> GetUpdatedPackages() { IPackageRepository aggregateRepository = registeredPackageRepositories.CreateAggregateRepository(); IPackageManagementProject project = ConsoleHost.GetProject(aggregateRepository, DefaultProject.Name); var updatedPackages = new UpdatedPackages(project, aggregateRepository); updatedPackages.SearchTerms = Filter; return updatedPackages.GetUpdatedPackages().AsQueryable(); }