Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
        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);
        }