public VsPackageManagerFactory(ISolutionManager solutionManager, IPackageRepositoryFactory repositoryFactory, IFileSystemProvider fileSystemProvider, IRepositorySettings repositorySettings, IRecentPackageRepository recentPackagesRepository) { if (solutionManager == null) { throw new ArgumentNullException("solutionManager"); } if (repositoryFactory == null) { throw new ArgumentNullException("repositoryFactory"); } if (fileSystemProvider == null) { throw new ArgumentNullException("fileSystemProvider"); } if (repositorySettings == null) { throw new ArgumentNullException("repositorySettings"); } _fileSystemProvider = fileSystemProvider; _repositorySettings = repositorySettings; _solutionManager = solutionManager; _repositoryFactory = repositoryFactory; _recentPackageRepository = recentPackagesRepository; _solutionManager.SolutionClosing += (sender, e) => { _repositoryInfo = null; }; }
public AddPackagesDialog( ManagePackagesViewModel parentViewModel, string initialSearch, IBackgroundPackageActionRunner backgroundActionRunner, IRecentPackageRepository recentPackageRepository) { this.parentViewModel = parentViewModel; this.viewModel = parentViewModel.AvailablePackagesViewModel; this.backgroundActionRunner = backgroundActionRunner; this.recentPackageRepository = recentPackageRepository; Build(); UpdatePackageSearchEntryWithInitialText(initialSearch); InitializeListView(); UpdateAddPackagesButton(); ShowLoadingMessage(); LoadViewModel(initialSearch); this.showPrereleaseCheckBox.Clicked += ShowPrereleaseCheckBoxClicked; this.packageSourceComboBox.SelectionChanged += PackageSourceChanged; this.addPackagesButton.Clicked += AddPackagesButtonClicked; this.packageSearchEntry.Changed += PackageSearchEntryChanged; this.packageSearchEntry.Activated += PackageSearchEntryActivated; imageLoader.Loaded += ImageLoaded; }
public AddPackagesDialog ( ManagePackagesViewModel parentViewModel, string initialSearch, IBackgroundPackageActionRunner backgroundActionRunner, IRecentPackageRepository recentPackageRepository) { this.parentViewModel = parentViewModel; this.viewModel = parentViewModel.AvailablePackagesViewModel; this.backgroundActionRunner = backgroundActionRunner; this.recentPackageRepository = recentPackageRepository; Build (); UpdatePackageSearchEntryWithInitialText (initialSearch); InitializeListView (); UpdateAddPackagesButton (); ShowLoadingMessage (); LoadViewModel (initialSearch); this.showPrereleaseCheckBox.Clicked += ShowPrereleaseCheckBoxClicked; this.packageSourceComboBox.SelectionChanged += PackageSourceChanged; this.addPackagesButton.Clicked += AddPackagesButtonClicked; this.packageSearchEntry.Changed += PackageSearchEntryChanged; this.packageSearchEntry.Activated += PackageSearchEntryActivated; imageLoader.Loaded += ImageLoaded; }
public void RecentPackageRepository_PropertyAccessed_ReturnsRecentPackageRepositoryFromCache() { CreateRegisteredPackageRepositories(); IRecentPackageRepository recentRepository = registeredRepositories.RecentPackageRepository; FakeRecentPackageRepository expectedRepository = fakeRepositoryCache.FakeRecentPackageRepository; Assert.AreEqual(expectedRepository, recentRepository); }
public void RecentPackageRepository_NoRecentPackages_ReturnsRecentRepositoryCreatedByFactory() { CreateCache(); IRecentPackageRepository repository = cache.RecentPackageRepository; FakeRecentPackageRepository expectedRepository = fakePackageRepositoryFactory.FakeRecentPackageRepository; Assert.AreEqual(expectedRepository, repository); }
private PackageManagerWindow(Project project, DTE dte, IVsPackageManagerFactory packageManagerFactory, IPackageRepositoryFactory repositoryFactory, IPackageSourceProvider packageSourceProvider, IRecentPackageRepository recentPackagesRepository, IHttpClientEvents httpClientEvents, IProductUpdateService productUpdateService, IPackageRestoreManager packageRestoreManager, ISolutionManager solutionManager, IOptionsPageActivator optionPageActivator) : base(F1Keyword) { InitializeComponent(); #if !VS10 // set unique search guid for VS11 explorer.SearchCategory = new Guid("{85566D5F-E585-411F-B299-5BF006E9F11E}"); #endif _httpClientEvents = httpClientEvents; if (_httpClientEvents != null) { _httpClientEvents.SendingRequest += OnSendingRequest; } _productUpdateService = productUpdateService; _optionsPageActivator = optionPageActivator; _activeProject = project; // replace the ConsoleOutputProvider with SmartOutputConsoleProvider so that we can clear // the console the first time an entry is written to it var providerServices = new ProviderServices(); _smartOutputConsoleProvider = new SmartOutputConsoleProvider(providerServices.OutputConsoleProvider); providerServices.OutputConsoleProvider = _smartOutputConsoleProvider; _providerSettings = providerServices.ProviderSettings; AddUpdateBar(productUpdateService); AddRestoreBar(packageRestoreManager); InsertDisclaimerElement(); AdjustSortComboBoxWidth(); PreparePrereleaseComboBox(); SetupProviders( project, dte, packageManagerFactory, repositoryFactory, packageSourceProvider, providerServices, recentPackagesRepository, httpClientEvents, solutionManager, packageRestoreManager); }
public VsPackageManagerFactory(ISolutionManager solutionManager, IPackageRepositoryFactory repositoryFactory, IVsPackageSourceProvider packageSourceProvider, IFileSystemProvider fileSystemProvider, IRepositorySettings repositorySettings, IRecentPackageRepository recentPackagesRepository, VsPackageInstallerEvents packageEvents) : this(solutionManager, repositoryFactory, packageSourceProvider, fileSystemProvider, repositorySettings, recentPackagesRepository, packageEvents, MachineCache.Default) { }
public void RecentPackageRepository_NoRecentPackages_CreatedWithAggregateRepository() { CreateCache(); IRecentPackageRepository repository = cache.RecentPackageRepository; IPackageRepository expectedRepository = MachineCache.Default; IPackageRepository actualRepository = fakePackageRepositoryFactory.AggregateRepositoryPassedToCreateRecentPackageRepository; Assert.AreEqual(expectedRepository, actualRepository); }
public void RecentPackageRepository_PropertyAccessedTwice_AggregateRepositoryCreatedOnce() { CreateCache(); IRecentPackageRepository repository = cache.RecentPackageRepository; fakePackageRepositoryFactory.RepositoriesPassedToCreateAggregateRepository = null; repository = cache.RecentPackageRepository; Assert.IsNull(fakePackageRepositoryFactory.RepositoriesPassedToCreateAggregateRepository); }
public IRecentPackageRepository CreateRecentPackageRepository( IList <RecentPackageInfo> recentPackages, IPackageRepository aggregateRepository) { if (recentPackageRepository == null) { recentPackageRepository = factory.CreateRecentPackageRepository(recentPackages, aggregateRepository); } return(recentPackageRepository); }
public GeneralOptionControl() { InitializeComponent(); _productUpdateSettings = ServiceLocator.GetInstance<IProductUpdateSettings>(); Debug.Assert(_productUpdateSettings != null); _recentPackageRepository = ServiceLocator.GetInstance<IRecentPackageRepository>(); Debug.Assert(_recentPackageRepository != null); }
public GeneralOptionControl() { InitializeComponent(); _productUpdateSettings = ServiceLocator.GetInstance <IProductUpdateSettings>(); Debug.Assert(_productUpdateSettings != null); _recentPackageRepository = ServiceLocator.GetInstance <IRecentPackageRepository>(); Debug.Assert(_recentPackageRepository != null); }
public VsPackageManagerFactory(ISolutionManager solutionManager, IPackageRepositoryFactory repositoryFactory, IVsPackageSourceProvider packageSourceProvider, IFileSystemProvider fileSystemProvider, IRepositorySettings repositorySettings, IRecentPackageRepository recentPackagesRepository, VsPackageInstallerEvents packageEvents, IPackageRepository cacheRepository) { if (solutionManager == null) { throw new ArgumentNullException("solutionManager"); } if (repositoryFactory == null) { throw new ArgumentNullException("repositoryFactory"); } if (packageSourceProvider == null) { throw new ArgumentNullException("packageSourceProvider"); } if (fileSystemProvider == null) { throw new ArgumentNullException("fileSystemProvider"); } if (repositorySettings == null) { throw new ArgumentNullException("repositorySettings"); } if (cacheRepository == null) { throw new ArgumentNullException("cacheRepository"); } if (packageEvents == null) { throw new ArgumentNullException("packageEvents"); } _fileSystemProvider = fileSystemProvider; _repositorySettings = repositorySettings; _solutionManager = solutionManager; _repositoryFactory = repositoryFactory; _recentPackageRepository = recentPackagesRepository; _packageSourceProvider = packageSourceProvider; _packageEvents = packageEvents; _cacheRepository = cacheRepository; _solutionManager.SolutionClosing += (sender, e) => { _repositoryInfo = null; }; }
public AvailablePackagesViewModel( IRegisteredPackageRepositories registeredPackageRepositories, IRecentPackageRepository recentPackageRepository, IPackageViewModelFactory packageViewModelFactory, ITaskFactory taskFactory) : base(registeredPackageRepositories, packageViewModelFactory, taskFactory) { this.recentPackageRepository = recentPackageRepository; IsSearchable = true; ShowPackageSources = true; ShowPrerelease = true; }
public PackageManagementOptionsViewModel( IRecentPackageRepository recentPackageRepository, IMachinePackageCache machinePackageCache, IProcess process) { this.recentPackageRepository = recentPackageRepository; this.machinePackageCache = machinePackageCache; this.process = process; this.HasNoRecentPackages = !RecentPackageRepositoryHasPackages(); this.HasNoCachedPackages = !MachinePackageCacheHasPackages(); CreateCommands(); }
public AvailablePackagesViewModel ( IPackageManagementSolution solution, IRegisteredPackageRepositories registeredPackageRepositories, IRecentPackageRepository recentPackageRepository, IPackageViewModelFactory packageViewModelFactory, ITaskFactory taskFactory) : base(registeredPackageRepositories, packageViewModelFactory, taskFactory) { this.solutionPackageRepository = solution.GetRepository (); this.recentPackageRepository = recentPackageRepository; IsSearchable = true; ShowPackageSources = true; ShowPrerelease = true; }
public AvailablePackagesViewModel( IPackageManagementSolution solution, IRegisteredPackageRepositories registeredPackageRepositories, IRecentPackageRepository recentPackageRepository, IPackageViewModelFactory packageViewModelFactory, ITaskFactory taskFactory) : base(registeredPackageRepositories, packageViewModelFactory, taskFactory) { this.solutionPackageRepository = solution.GetRepository(); this.recentPackageRepository = recentPackageRepository; IsSearchable = true; ShowPackageSources = true; ShowPrerelease = true; }
public VsPackageManager(ISolutionManager solutionManager, IPackageRepository sourceRepository, IFileSystem fileSystem, ISharedPackageRepository sharedRepository, IRecentPackageRepository recentPackagesRepository, VsPackageInstallerEvents packageEvents) : base(sourceRepository, new DefaultPackagePathResolver(fileSystem), fileSystem, sharedRepository) { _solutionManager = solutionManager; _sharedRepository = sharedRepository; _recentPackagesRepository = recentPackagesRepository; _packageEvents = packageEvents; _projects = new Dictionary<string, IProjectManager>(StringComparer.OrdinalIgnoreCase); }
public void RecentPackageRepository_OneRecentPackage_RecentPackageUsedToCreateRecentPackageRepository() { CreateCache(); RecentPackageInfo recentPackage = AddOneRecentPackage(); IRecentPackageRepository repository = cache.RecentPackageRepository; IList <RecentPackageInfo> actualRecentPackages = fakePackageRepositoryFactory.RecentPackagesPassedToCreateRecentPackageRepository; var expectedRecentPackages = new RecentPackageInfo[] { recentPackage }; Assert.AreEqual(expectedRecentPackages, actualRecentPackages); }
public PackageManagerWindow(DTE dte, IVsUIShell vsUIShell, IVsPackageManagerFactory packageManagerFactory, IPackageRepositoryFactory repositoryFactory, IPackageSourceProvider packageSourceProvider, ProviderServices providerServices, IRecentPackageRepository recentPackagesRepository, IHttpClientEvents httpClientEvents, ISelectedProviderSettings selectedProviderSettings, IProductUpdateService productUpdateService) : base(F1Keyword) { InitializeComponent(); _httpClientEvents = httpClientEvents; if (_httpClientEvents != null) { _httpClientEvents.SendingRequest += OnSendingRequest; } AddUpdateBar(productUpdateService); _vsUIShell = vsUIShell; _selectedProviderSettings = selectedProviderSettings; _productUpdateService = productUpdateService; InsertDisclaimerElement(); AdjustSortComboBoxWidth(); // replace the ConsoleOutputProvider with SmartOutputConsoleProvider so that we can clear // the console the first time an entry is written to it _smartOutputConsoleProvider = new SmartOutputConsoleProvider(providerServices.OutputConsoleProvider); providerServices = new ProviderServices( providerServices.LicenseWindow, providerServices.ProgressWindow, providerServices.ScriptExecutor, _smartOutputConsoleProvider); SetupProviders( dte, packageManagerFactory, repositoryFactory, packageSourceProvider, providerServices, recentPackagesRepository, httpClientEvents); }
public PackageManagementOptionsViewModel( PackageManagementOptions options, IRecentPackageRepository recentPackageRepository, IMachinePackageCache machinePackageCache, IProcess process) { this.options = options; this.recentPackageRepository = recentPackageRepository; this.machinePackageCache = machinePackageCache; this.process = process; this.HasNoRecentPackages = !RecentPackageRepositoryHasPackages(); this.HasNoCachedPackages = !MachinePackageCacheHasPackages(); this.IsAutomaticPackageRestoreOnOpeningSolutionEnabled = options.IsAutomaticPackageRestoreOnOpeningSolutionEnabled; CreateCommands(); }
public VsPackageManager(ISolutionManager solutionManager, IPackageRepository sourceRepository, IFileSystemProvider fileSystemProvider, IFileSystem fileSystem, ISharedPackageRepository sharedRepository, IRecentPackageRepository recentPackagesRepository, VsPackageInstallerEvents packageEvents) : base(sourceRepository, new DefaultPackagePathResolver(fileSystem), fileSystem, sharedRepository) { _solutionManager = solutionManager; _sharedRepository = sharedRepository; _recentPackagesRepository = recentPackagesRepository; _packageEvents = packageEvents; _fileSystemProvider = fileSystemProvider; _projects = new Dictionary <string, IProjectManager>(StringComparer.OrdinalIgnoreCase); }
public PackagesViewModels( IPackageManagementSolution solution, IRegisteredPackageRepositories registeredPackageRepositories, IThreadSafePackageManagementEvents packageManagementEvents, IPackageActionRunner actionRunner, ITaskFactory taskFactory) { var packageViewModelFactory = new PackageViewModelFactory(solution, packageManagementEvents, actionRunner); //var updatedPackageViewModelFactory = new UpdatedPackageViewModelFactory(packageViewModelFactory); //var installedPackageViewModelFactory = new InstalledPackageViewModelFactory(packageViewModelFactory); IRecentPackageRepository recentPackageRepository = PackageManagementServices.RecentPackageRepository; AvailablePackagesViewModel = new AvailablePackagesViewModel(solution, registeredPackageRepositories, recentPackageRepository, packageViewModelFactory, taskFactory); //InstalledPackagesViewModel = new InstalledPackagesViewModel(solution, packageManagementEvents, registeredPackageRepositories, installedPackageViewModelFactory, taskFactory); //UpdatedPackagesViewModel = new UpdatedPackagesViewModel(solution, registeredPackageRepositories, updatedPackageViewModelFactory, taskFactory); //RecentPackagesViewModel = new RecentPackagesViewModel(packageManagementEvents, registeredPackageRepositories, packageViewModelFactory, taskFactory); }
public GeneralOptionControl() { InitializeComponent(); _productUpdateSettings = ServiceLocator.GetInstance<IProductUpdateSettings>(); Debug.Assert(_productUpdateSettings != null); _recentPackageRepository = ServiceLocator.GetInstance<IRecentPackageRepository>(); Debug.Assert(_recentPackageRepository != null); _settings = ServiceLocator.GetInstance<ISettings>(); Debug.Assert(_settings != null); if (!VsVersionHelper.IsVisualStudio2010) { // Starting from VS11, we don't need to check for updates anymore because VS will do it. Controls.Remove(updatePanel); } }
public GeneralOptionControl() { InitializeComponent(); _productUpdateSettings = ServiceLocator.GetInstance <IProductUpdateSettings>(); Debug.Assert(_productUpdateSettings != null); _recentPackageRepository = ServiceLocator.GetInstance <IRecentPackageRepository>(); Debug.Assert(_recentPackageRepository != null); _settings = ServiceLocator.GetInstance <ISettings>(); Debug.Assert(_settings != null); if (!VsVersionHelper.IsVisualStudio2010) { // Starting from VS11, we don't need to check for updates anymore because VS will do it. Controls.Remove(updatePanel); } }
public void RecentPackageRepository_OnePackageSource_OneRepositoryCreatedForPackageSourceAndUsedToCreateAggregateRepository() { CreatePackageSources(); packageSourcesHelper.AddOnePackageSource("Source1"); CreateCacheUsingPackageSources(); FakePackageRepository repository = AddFakePackageRepositoryForPackageSource("Source1"); var expectedRepositories = new FakePackageRepository[] { repository }; IRecentPackageRepository recentRepository = cache.RecentPackageRepository; IEnumerable <IPackageRepository> repositoriesUsedToCreateAggregateRepository = fakePackageRepositoryFactory.RepositoriesPassedToCreateAggregateRepository; var actualRepositoriesAsList = new List <IPackageRepository>(repositoriesUsedToCreateAggregateRepository); IPackageRepository[] actualRepositories = actualRepositoriesAsList.ToArray(); CollectionAssert.AreEqual(expectedRepositories, actualRepositories); }
public PackageManagementOptionsViewModel(IRecentPackageRepository recentPackageRepository) : this(PackageManagementServices.Options, recentPackageRepository, new MachinePackageCache(), new Process()) { }
public IRecentPackageRepository CreateRecentPackageRepository( IList<RecentPackageInfo> recentPackages, IPackageRepository aggregateRepository) { if (recentPackageRepository == null) { recentPackageRepository = factory.CreateRecentPackageRepository(recentPackages, aggregateRepository); } return recentPackageRepository; }