// Non-private only to facilitate testing. internal NuGetUIContext( IServiceBroker serviceBroker, IReconnectingNuGetSearchService nuGetSearchService, IVsSolutionManager solutionManager, NuGetSolutionManagerServiceWrapper solutionManagerService, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IUserSettingsManager userSettingsManager, NuGetSourcesServiceWrapper sourceService) { ServiceBroker = serviceBroker; ReconnectingSearchService = nuGetSearchService; SolutionManager = solutionManager; _solutionManagerService = solutionManagerService; PackageManager = packageManager; UIActionEngine = uiActionEngine; PackageManager = packageManager; PackageRestoreManager = packageRestoreManager; OptionsPageActivator = optionsPageActivator; UserSettingsManager = userSettingsManager; _sourceService = sourceService; ServiceBroker.AvailabilityChanged += OnAvailabilityChanged; SolutionManager.ActionsExecuted += OnActionsExecuted; }
private PackageManagerWindow(Project project, DTE dte, IVsPackageManagerFactory packageManagerFactory, IPackageRepositoryFactory repositoryFactory, IPackageSourceProvider packageSourceProvider, IHttpClientEvents httpClientEvents, IProductUpdateService productUpdateService, IPackageRestoreManager packageRestoreManager, ISolutionManager solutionManager, IOptionsPageActivator optionPageActivator, IDeleteOnRestartManager deleteOnRestartManager, IVsShell4 vsRestarter, string dialogParameters) : 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); var restartRequestBar = AddRestartRequestBar(deleteOnRestartManager, vsRestarter); InsertDisclaimerElement(); AdjustSortComboBoxWidth(); PreparePrereleaseComboBox(); SetupProviders( project, dte, packageManagerFactory, repositoryFactory, packageSourceProvider, providerServices, httpClientEvents, solutionManager, packageRestoreManager, restartRequestBar); ProcessDialogParameters(dialogParameters); }
// Non-private only to facilitate testing. internal NuGetUIContext( ISourceRepositoryProvider sourceProvider, IServiceBroker serviceBroker, IVsSolutionManager solutionManager, NuGetSolutionManagerServiceWrapper solutionManagerService, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IUserSettingsManager userSettingsManager, IEnumerable <IVsPackageManagerProvider> packageManagerProviders) { SourceProvider = sourceProvider; ServiceBroker = serviceBroker; SolutionManager = solutionManager; _solutionManagerService = solutionManagerService; PackageManager = packageManager; UIActionEngine = uiActionEngine; PackageManager = packageManager; PackageRestoreManager = packageRestoreManager; OptionsPageActivator = optionsPageActivator; UserSettingsManager = userSettingsManager; PackageManagerProviders = packageManagerProviders; ServiceBroker.AvailabilityChanged += OnAvailabilityChanged; SolutionManager.ActionsExecuted += OnActionsExecuted; }
public static async Task <NuGetUI> CreateAsync( IServiceBroker serviceBroker, ICommonOperations commonOperations, NuGetUIProjectContext projectContext, ISourceRepositoryProvider sourceRepositoryProvider, ISettings settings, IVsSolutionManager solutionManager, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IUserSettingsManager userSettingsManager, IDeleteOnRestartManager deleteOnRestartManager, SolutionUserOptions solutionUserOptions, INuGetLockService lockService, INuGetUILogger logger, IRestoreProgressReporter restoreProgressReporter, CancellationToken cancellationToken, params IProjectContextInfo[] projects) { Assumes.NotNull(serviceBroker); Assumes.NotNull(commonOperations); Assumes.NotNull(projectContext); Assumes.NotNull(sourceRepositoryProvider); Assumes.NotNull(settings); Assumes.NotNull(solutionManager); Assumes.NotNull(packageRestoreManager); Assumes.NotNull(optionsPageActivator); Assumes.NotNull(userSettingsManager); Assumes.NotNull(deleteOnRestartManager); Assumes.NotNull(solutionUserOptions); Assumes.NotNull(lockService); Assumes.NotNull(restoreProgressReporter); Assumes.NotNull(logger); cancellationToken.ThrowIfCancellationRequested(); var nuGetUi = new NuGetUI( commonOperations, projectContext, logger) { UIContext = await NuGetUIContext.CreateAsync( serviceBroker, sourceRepositoryProvider, settings, solutionManager, packageRestoreManager, optionsPageActivator, solutionUserOptions, deleteOnRestartManager, lockService, restoreProgressReporter, cancellationToken) }; nuGetUi.UIContext.Projects = projects; return(nuGetUi); }
public static async ValueTask <NuGetUIContext> CreateAsync( IServiceBroker serviceBroker, ISourceRepositoryProvider sourceRepositoryProvider, ISettings settings, IVsSolutionManager solutionManager, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IUserSettingsManager userSettingsManager, IDeleteOnRestartManager deleteOnRestartManager, IEnumerable <IVsPackageManagerProvider> packageManagerProviders, INuGetLockService lockService, CancellationToken cancellationToken) { Assumes.NotNull(serviceBroker); Assumes.NotNull(sourceRepositoryProvider); Assumes.NotNull(settings); Assumes.NotNull(solutionManager); Assumes.NotNull(packageRestoreManager); Assumes.NotNull(optionsPageActivator); Assumes.NotNull(userSettingsManager); Assumes.NotNull(deleteOnRestartManager); Assumes.NotNull(packageManagerProviders); Assumes.NotNull(lockService); cancellationToken.ThrowIfCancellationRequested(); var solutionManagerServiceWrapper = new NuGetSolutionManagerServiceWrapper(); INuGetSolutionManagerService solutionManagerService = await GetSolutionManagerServiceAsync(serviceBroker, cancellationToken); // The initial Swap(...) should return a null implementation of the interface that does not require disposal. // However, there's no harm in following form. using (solutionManagerServiceWrapper.Swap(solutionManagerService)) { } var packageManager = new NuGetPackageManager( sourceRepositoryProvider, settings, solutionManager, deleteOnRestartManager); var actionEngine = new UIActionEngine( sourceRepositoryProvider, packageManager, lockService); return(new NuGetUIContext( sourceRepositoryProvider, serviceBroker, solutionManager, solutionManagerServiceWrapper, packageManager, actionEngine, packageRestoreManager, optionsPageActivator, userSettingsManager, packageManagerProviders)); }
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 StandaloneUIContextFactory(ISourceRepositoryProvider repositoryProvider, ISolutionManager solutionManager, ISettings settings, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPage) { _repositoryProvider = repositoryProvider; _solutionManager = solutionManager; _settings = settings; _restoreManager = packageRestoreManager; _optionsPage = optionsPage; }
public VisualStudioUIContextFactory([Import]ISourceRepositoryProvider repositoryProvider, [Import]ISolutionManager solutionManager, [Import]ISettings settings, [Import]IPackageRestoreManager packageRestoreManager, [Import]IOptionsPageActivator optionsPage) { _repositoryProvider = repositoryProvider; _solutionManager = solutionManager; _restoreManager = packageRestoreManager; _optionsPage = optionsPage; _settings = settings; }
public VisualStudioUIContextFactory([Import] ISourceRepositoryProvider repositoryProvider, [Import] ISolutionManager solutionManager, [Import] ISettings settings, [Import] IPackageRestoreManager packageRestoreManager, [Import] IOptionsPageActivator optionsPage) { _repositoryProvider = repositoryProvider; _solutionManager = solutionManager; _restoreManager = packageRestoreManager; _optionsPage = optionsPage; _settings = settings; }
public VisualStudioUIContext( NuGetPackage package, ISourceRepositoryProvider sourceProvider, ISolutionManager solutionManager, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IEnumerable <NuGet.ProjectManagement.NuGetProject> projects) : base(sourceProvider, solutionManager, packageManager, uiActionEngine, packageRestoreManager, optionsPageActivator, projects) { _package = package; }
public VisualStudioUIContext( NuGetPackage package, ISourceRepositoryProvider sourceProvider, ISolutionManager solutionManager, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IEnumerable<NuGet.ProjectManagement.NuGetProject> projects) : base(sourceProvider, solutionManager, packageManager, uiActionEngine, packageRestoreManager, optionsPageActivator, projects) { _package = package; }
public StandaloneUIContext( string settingsFile, ISourceRepositoryProvider sourceProvider, ISolutionManager solutionManager, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IEnumerable <NuGet.ProjectManagement.NuGetProject> projects) : base(sourceProvider, solutionManager, packageManager, uiActionEngine, packageRestoreManager, optionsPageActivator, projects) { _settingsFile = settingsFile; LoadSettings(); }
public StandaloneUIContext( string settingsFile, ISourceRepositoryProvider sourceProvider, ISolutionManager solutionManager, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IEnumerable<NuGet.ProjectManagement.NuGetProject> projects) : base(sourceProvider, solutionManager, packageManager, uiActionEngine, packageRestoreManager, optionsPageActivator, projects) { _settingsFile = settingsFile; LoadSettings(); }
public VisualStudioUIContextFactory([Import] ISourceRepositoryProvider repositoryProvider, [Import] ISolutionManager solutionManager, [Import] ISettings settings, [Import] IPackageRestoreManager packageRestoreManager, [Import] IOptionsPageActivator optionsPage, [Import] IDeleteOnRestartManager deleteOnRestartManager, [ImportMany] IEnumerable <Lazy <IVsPackageManagerProvider, IOrderable> > packageManagerProviders) { _repositoryProvider = repositoryProvider; _solutionManager = solutionManager; _restoreManager = packageRestoreManager; _optionsPage = optionsPage; _settings = settings; _deleteOnRestartManager = deleteOnRestartManager; _packageManagerProviders = PackageManagerProviderUtility.Sort(packageManagerProviders, MaxPackageManager); }
public NuGetUIContextBase( ISourceRepositoryProvider sourceProvider, ISolutionManager solutionManager, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IEnumerable <NuGetProject> projects) { _sourceProvider = sourceProvider; _solutionManager = solutionManager; _packageManager = packageManager; _uiActionEngine = uiActionEngine; _packageManager = packageManager; _packageRestoreManager = packageRestoreManager; _optionsPageActivator = optionsPageActivator; _projects = projects.ToArray(); }
public NuGetUIContextBase( ISourceRepositoryProvider sourceProvider, ISolutionManager solutionManager, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IEnumerable<NuGetProject> projects) { _sourceProvider = sourceProvider; _solutionManager = solutionManager; _packageManager = packageManager; _uiActionEngine = uiActionEngine; _packageManager = packageManager; _packageRestoreManager = packageRestoreManager; _optionsPageActivator = optionsPageActivator; _projects = projects.ToArray(); }
protected NuGetUIContextBase( ISourceRepositoryProvider sourceProvider, ISolutionManager solutionManager, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IEnumerable <NuGetProject> projects, IEnumerable <IVsPackageManagerProvider> packageManagerProviders) { SourceProvider = sourceProvider; SolutionManager = solutionManager; PackageManager = packageManager; UIActionEngine = uiActionEngine; PackageManager = packageManager; PackageRestoreManager = packageRestoreManager; OptionsPageActivator = optionsPageActivator; _projects = projects.ToArray(); PackageManagerProviders = packageManagerProviders; }
public NuGetUIContext( ISourceRepositoryProvider sourceProvider, ISolutionManager solutionManager, NuGetPackageManager packageManager, UIActionEngine uiActionEngine, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IUserSettingsManager userSettingsManager, IEnumerable <IVsPackageManagerProvider> packageManagerProviders) { SourceProvider = sourceProvider; SolutionManager = solutionManager; PackageManager = packageManager; UIActionEngine = uiActionEngine; PackageManager = packageManager; PackageRestoreManager = packageRestoreManager; OptionsPageActivator = optionsPageActivator; UserSettingsManager = userSettingsManager; PackageManagerProviders = packageManagerProviders; }
private PackageManagerWindow(Project project, DTE dte, IVsPackageManagerFactory packageManagerFactory, IPackageRepositoryFactory repositoryFactory, IPackageSourceProvider packageSourceProvider, IHttpClientEvents httpClientEvents, IProductUpdateService productUpdateService, IPackageRestoreManager packageRestoreManager, ISolutionManager solutionManager, IOptionsPageActivator optionPageActivator, IDeleteOnRestartManager deleteOnRestartManager, IVsShell4 vsRestarter, string dialogParameters) : 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; _updateAllUIService = providerServices.UpdateAllUIService; providerServices.ProgressWindow.UpgradeNuGetRequested += (_, __) => { Close(); productUpdateService.Update(); }; AddUpdateBar(productUpdateService); AddRestoreBar(packageRestoreManager); var restartRequestBar = AddRestartRequestBar(deleteOnRestartManager, vsRestarter); InsertDisclaimerElement(); AdjustSortComboBoxWidth(); PreparePrereleaseComboBox(); InsertUpdateAllButton(providerServices.UpdateAllUIService); SetupProviders( project, dte, packageManagerFactory, repositoryFactory, packageSourceProvider, providerServices, httpClientEvents, solutionManager, packageRestoreManager, restartRequestBar); ProcessDialogParameters(dialogParameters); }
public static async ValueTask <NuGetUIContext> CreateAsync( IServiceBroker serviceBroker, ISourceRepositoryProvider sourceRepositoryProvider, ISettings settings, IVsSolutionManager solutionManager, IPackageRestoreManager packageRestoreManager, IOptionsPageActivator optionsPageActivator, IUserSettingsManager userSettingsManager, IDeleteOnRestartManager deleteOnRestartManager, IEnumerable <IVsPackageManagerProvider> packageManagerProviders, INuGetLockService lockService, CancellationToken cancellationToken) { Assumes.NotNull(serviceBroker); Assumes.NotNull(sourceRepositoryProvider); Assumes.NotNull(settings); Assumes.NotNull(solutionManager); Assumes.NotNull(packageRestoreManager); Assumes.NotNull(optionsPageActivator); Assumes.NotNull(userSettingsManager); Assumes.NotNull(deleteOnRestartManager); Assumes.NotNull(packageManagerProviders); Assumes.NotNull(lockService); cancellationToken.ThrowIfCancellationRequested(); var solutionManagerServiceWrapper = new NuGetSolutionManagerServiceWrapper(); INuGetSolutionManagerService solutionManagerService = await GetSolutionManagerServiceAsync(serviceBroker, cancellationToken); // The initial Swap(...) should return a null implementation of the interface that does not require disposal. // However, there's no harm in following form. using (solutionManagerServiceWrapper.Swap(solutionManagerService)) { } var sourceServiceWrapper = new NuGetSourcesServiceWrapper(); INuGetSourcesService sourceService = await GetSourceServiceAsync(serviceBroker, cancellationToken); using (sourceServiceWrapper.Swap(sourceService)) { } #pragma warning disable CA2000 // Dispose objects before losing scope - NuGetUIContext owns the instance and should dispose it. var searchService = await NuGetSearchServiceReconnector.CreateAsync(serviceBroker, NuGetUIThreadHelper.JoinableTaskFactory, cancellationToken); #pragma warning restore CA2000 // Dispose objects before losing scope var packageManager = new NuGetPackageManager( sourceRepositoryProvider, settings, solutionManager, deleteOnRestartManager); var actionEngine = new UIActionEngine( sourceRepositoryProvider, packageManager, lockService); return(new NuGetUIContext( serviceBroker, searchService.Object, solutionManager, solutionManagerServiceWrapper, packageManager, actionEngine, packageRestoreManager, optionsPageActivator, userSettingsManager, packageManagerProviders, sourceServiceWrapper)); }