예제 #1
0
        static PackageManagementServices()
        {
            options = new PackageManagementOptions();

            progressMonitorFactory        = new PackageManagementProgressMonitorFactory();
            backgroundPackageActionRunner = new BackgroundPackageActionRunner(progressMonitorFactory, packageManagementEvents);

            projectTargetFrameworkMonitor = new ProjectTargetFrameworkMonitor(projectService);
            packageCompatibilityHandler   = new PackageCompatibilityHandler();
            packageCompatibilityHandler.MonitorTargetFrameworkChanges(projectTargetFrameworkMonitor);

            updatedPackagesInWorkspace = new UpdatedNuGetPackagesInWorkspace(packageManagementEvents);

            projectOperations = new PackageManagementProjectOperations(backgroundPackageActionRunner, packageManagementEvents);

            workspace = new PackageManagementWorkspace();

            pluginManager = CreatePluginManager();

            credentialService = new PackageManagementCredentialService();
            credentialService.Initialize();

            PackageManagementBackgroundDispatcher.Initialize();

            nuGetConfigFileChangedMonitor.MonitorFileChanges();

            //analyzerPackageMonitor = new AnalyzerPackageMonitor ();
            MonoDevelop.Refactoring.PackageInstaller.PackageInstallerServiceFactory.PackageServices = new MonoDevelop.PackageManagement.Refactoring.NuGetPackageServicesProxy();
        }
        static PackageManagementServices()
        {
            options = new PackageManagementOptions();
            packageRepositoryCache = new PackageRepositoryCache(options);
            userAgentGenerator     = new UserAgentGeneratorForRepositoryRequests();
            userAgentGenerator.Register(packageRepositoryCache);
            progressProvider = new PackageManagementProgressProvider(packageRepositoryCache);
            registeredPackageRepositories         = new RegisteredPackageRepositories(packageRepositoryCache, options);
            projectTemplatePackageSources         = new RegisteredProjectTemplatePackageSources();
            projectTemplatePackageRepositoryCache = new ProjectTemplatePackageRepositoryCache(projectTemplatePackageSources);

            outputMessagesView  = new PackageManagementOutputMessagesView(packageManagementEvents);
            solution            = new PackageManagementSolution(registeredPackageRepositories, projectService, packageManagementEvents);
            packageActionRunner = new PackageActionRunner(packageManagementEvents);

            progressMonitorFactory        = new PackageManagementProgressMonitorFactory();
            backgroundPackageActionRunner = new BackgroundPackageActionRunner(progressMonitorFactory, packageManagementEvents, progressProvider);

            projectTargetFrameworkMonitor = new ProjectTargetFrameworkMonitor(projectService);
            packageCompatibilityHandler   = new PackageCompatibilityHandler();
            packageCompatibilityHandler.MonitorTargetFrameworkChanges(projectTargetFrameworkMonitor);

            updatedPackagesInSolution = new UpdatedPackagesInSolution(solution, registeredPackageRepositories, packageManagementEvents);

            projectOperations = new PackageManagementProjectOperations(solution, registeredPackageRepositories, backgroundPackageActionRunner, packageManagementEvents);

            InitializeCredentialProvider();
            PackageManagementBackgroundDispatcher.Initialize();
        }
 public void Execute()
 {
     // Queue the check for updates with the background dispatcher so
     // the NuGet addin does not create another separate Package Console.
     PackageManagementBackgroundDispatcher.Dispatch(() => {
         updatedPackagesInSolution.CheckForUpdates();
     });
 }
 public void Execute(CancellationToken cancellationToken)
 {
     // Queue the check for updates with the background dispatcher so
     // the NuGet addin does not create another separate Package Console.
     PackageManagementBackgroundDispatcher.Dispatch(() => {
         updatedPackagesInWorkspace.CheckForUpdates(solution);
     });
 }
예제 #5
0
        void Restore(PackageRestorer restorer, Action afterRestore)
        {
            ProgressMonitorStatusMessage progressMessage = ProgressMonitorStatusMessageFactory.CreateRestoringPackagesBeforeUpdateMessage();

            PackageManagementBackgroundDispatcher.Dispatch(() => {
                restorer.Restore(progressMessage);
                if (!restorer.RestoreFailed)
                {
                    afterRestore();
                }
            });
        }
 protected virtual void BackgroundDispatch(Action action)
 {
     PackageManagementBackgroundDispatcher.Dispatch(action);
 }
 protected virtual bool DispatcherIsDispatching()
 {
     return(PackageManagementBackgroundDispatcher.IsDispatching());
 }
 /// <summary>
 /// This will only remove queued actions not the action currently being run.
 /// </summary>
 protected virtual void ClearDispatcher()
 {
     PackageManagementBackgroundDispatcher.Clear();
 }
예제 #9
0
 protected virtual void BackgroundDispatch(MessageHandler handler)
 {
     PackageManagementBackgroundDispatcher.Dispatch(() => RunInternal());
 }