Exemplo n.º 1
0
        public PackageInstallationService(IServiceLocator serviceLocator, ITypeFactory typeFactory, IFrameworkNameProvider frameworkNameProvider, ISourceRepositoryProvider sourceRepositoryProvider, INuGetProjectConfigurationProvider nuGetProjectConfigurationProvider,
                                          INuGetProjectContextProvider nuGetProjectContextProvider, IDirectoryService directoryService, IFileService fileService, IApiPackageRegistry apiPackageRegistry, IFileSystemService fileSystemService, ILogger logger)
        {
            Argument.IsNotNull(() => frameworkNameProvider);
            Argument.IsNotNull(() => sourceRepositoryProvider);
            Argument.IsNotNull(() => nuGetProjectConfigurationProvider);
            Argument.IsNotNull(() => nuGetProjectContextProvider);
            Argument.IsNotNull(() => directoryService);
            Argument.IsNotNull(() => fileService);
            Argument.IsNotNull(() => apiPackageRegistry);
            Argument.IsNotNull(() => fileSystemService);
            Argument.IsNotNull(() => logger);

            _serviceLocator                    = serviceLocator;
            _typeFactory                       = typeFactory;
            _frameworkNameProvider             = frameworkNameProvider;
            _sourceRepositoryProvider          = sourceRepositoryProvider;
            _nuGetProjectConfigurationProvider = nuGetProjectConfigurationProvider;
            _nuGetProjectContextProvider       = nuGetProjectContextProvider;
            _directoryService                  = directoryService;
            _fileService                       = fileService;
            _apiPackageRegistry                = apiPackageRegistry;
            _fileSystemService                 = fileSystemService;
            _nugetLogger                       = logger;

            _nuGetCacheManager = new NuGetCacheManager(_directoryService, _fileService);

            if (serviceLocator.IsTypeRegistered <IDownloadingProgressTrackerService>())
            {
                _downloadingProgressTrackerService = serviceLocator.ResolveType <IDownloadingProgressTrackerService>();
            }

            _installerPathResolver = new VersionFolderPathResolver(DefaultNuGetFolders.GetGlobalPackagesFolder());
        }
        public PackageCommandService(IPleaseWaitService pleaseWaitService, IRepositoryService repositoryService, IPackageQueryService packageQueryService, IPackageOperationService packageOperationService, IPackageOperationContextService packageOperationContextService, IApiPackageRegistry apiPackageRegistry)
        {
            Argument.IsNotNull(() => pleaseWaitService);
            Argument.IsNotNull(() => packageQueryService);
            Argument.IsNotNull(() => packageOperationService);
            Argument.IsNotNull(() => packageOperationContextService);
            Argument.IsNotNull(() => apiPackageRegistry);

            _pleaseWaitService              = pleaseWaitService;
            _packageQueryService            = packageQueryService;
            _packageOperationService        = packageOperationService;
            _packageOperationContextService = packageOperationContextService;
            _apiPackageRegistry             = apiPackageRegistry;

            _localRepository = repositoryService.LocalRepository;
        }
        public PackageDetailsViewModel(IModelProvider <ExplorerSettingsContainer> settingsProvider, IProgressManager progressManager, IApiPackageRegistry apiPackageRegistry,
                                       IPackageCommandService packageCommandService)
        {
            Argument.IsNotNull(() => settingsProvider);
            Argument.IsNotNull(() => progressManager);
            Argument.IsNotNull(() => apiPackageRegistry);
            Argument.IsNotNull(() => packageCommandService);

            _settingsProvider      = settingsProvider;
            _progressManager       = progressManager;
            _apiPackageRegistry    = apiPackageRegistry;
            _packageCommandService = packageCommandService;

            LoadInfoAboutVersions = new Command(LoadInfoAboutVersionsExecute, () => Package is not null);
            InstallPackage        = new TaskCommand(OnInstallPackageExecuteAsync, OnInstallPackageCanExecute);
            UninstallPackage      = new TaskCommand(OnUninstallPackageExecuteAsync, OnUninstallPackageCanExecute);
        }
Exemplo n.º 4
0
        public PackageOperationService(IPackageOperationContextService packageOperationContextService, ILogger logger, IPackageManager packageManager,
                                       IRepositoryService repositoryService, IRepositoryCacheService repositoryCacheService, IApiPackageRegistry apiPackageRegistry)
        {
            Argument.IsNotNull(() => packageOperationContextService);
            Argument.IsNotNull(() => logger);
            Argument.IsNotNull(() => packageManager);
            Argument.IsNotNull(() => repositoryService);
            Argument.IsNotNull(() => repositoryCacheService);
            Argument.IsNotNull(() => apiPackageRegistry);

            _packageOperationContextService = packageOperationContextService;
            _logger                 = logger;
            _packageManager         = packageManager;
            _repositoryCacheService = repositoryCacheService;
            _apiPackageRegistry     = apiPackageRegistry;

            _localRepository = repositoryCacheService.GetNuGetRepository(repositoryService.LocalRepository);

            DependencyVersion = DependencyVersion.Lowest;
        }
Exemplo n.º 5
0
        public PackageOperationService(IPackageOperationContextService packageOperationContextService, ILogger logger, INuGetPackageManager nuGetPackageManager,
                                       IRepositoryService repositoryService, IApiPackageRegistry apiPackageRegistry, IDefaultExtensibleProjectProvider defaultExtensibleProjectProvider,
                                       ISourceRepositoryProvider sourceRepositoryProvider, IPackageOperationNotificationService packageOperationNotificationService)
        {
            Argument.IsNotNull(() => packageOperationContextService);
            Argument.IsNotNull(() => logger);
            Argument.IsNotNull(() => nuGetPackageManager);
            Argument.IsNotNull(() => repositoryService);
            Argument.IsNotNull(() => apiPackageRegistry);
            Argument.IsNotNull(() => sourceRepositoryProvider);
            Argument.IsNotNull(() => defaultExtensibleProjectProvider);
            Argument.IsNotNull(() => packageOperationNotificationService);

            _packageOperationContextService = packageOperationContextService;
            _logger = logger;
            _nuGetPackageManager = nuGetPackageManager;
            _apiPackageRegistry  = apiPackageRegistry;
            _packageOperationNotificationService = packageOperationNotificationService;
            _defaultProject = defaultExtensibleProjectProvider.GetDefaultProject();

            // Note: this setting should be global, probably set by Resolver (which replaced the old one InstallWalker);
            DependencyVersion = DependencyBehavior.Lowest;
        }