/// <summary>
        /// Returns the UI for the project or given set of projects.
        /// </summary>
        public async ValueTask <INuGetUI> CreateAsync(
            IServiceBroker serviceBroker,
            params IProjectContextInfo[] projects)
        {
            if (serviceBroker is null)
            {
                throw new ArgumentNullException(nameof(serviceBroker));
            }

            var adapterLogger = new LoggerAdapter(ProjectContext);

            ProjectContext.PackageExtractionContext = new PackageExtractionContext(
                PackageSaveMode.Defaultv2,
                PackageExtractionBehavior.XmlDocFileSaveMode,
                ClientPolicyContext.GetClientPolicy(Settings.Value, adapterLogger),
                adapterLogger);

            return(await NuGetUI.CreateAsync(
                       serviceBroker,
                       CommonOperations,
                       ProjectContext,
                       SourceRepositoryProvider.Value,
                       Settings.Value,
                       SolutionManager,
                       PackageRestoreManager.Value,
                       OptionsPageActivator.Value,
                       SolutionUserOptions,
                       DeleteOnRestartManager.Value,
                       SolutionUserOptions,
                       LockService.Value,
                       OutputConsoleLogger,
                       RestoreProgressReporter.Value,
                       CancellationToken.None,
                       projects));
        }
예제 #2
0
        /// <summary>
        /// Returns the UI for the project or given set of projects.
        /// </summary>
        public async ValueTask <INuGetUI> CreateAsync(params IProjectContextInfo[] projects)
        {
            var adapterLogger = new LoggerAdapter(ProjectContext);

            ProjectContext.PackageExtractionContext = new PackageExtractionContext(
                PackageSaveMode.Defaultv2,
                PackageExtractionBehavior.XmlDocFileSaveMode,
                ClientPolicyContext.GetClientPolicy(Settings.Value, adapterLogger),
                adapterLogger);

            // only pick up at most three integrated package managers
            const int MaxPackageManager       = 3;
            var       packageManagerProviders = PackageManagerProviderUtility.Sort(
                PackageManagerProviders, MaxPackageManager);

            return(await NuGetUI.CreateAsync(
                       CommonOperations,
                       ProjectContext,
                       SourceRepositoryProvider.Value,
                       Settings.Value,
                       SolutionManager,
                       PackageRestoreManager.Value,
                       OptionsPageActivator.Value,
                       SolutionUserOptions,
                       DeleteOnRestartManager.Value,
                       packageManagerProviders,
                       SolutionUserOptions,
                       LockService.Value,
                       OutputConsoleLogger,
                       CancellationToken.None,
                       projects));
        }