public ExplorerPageViewModel(ExplorerPage page, IPackageLoaderService packagesLoaderService,
                                     IModelProvider <ExplorerSettingsContainer> settingsProvider, IPackageMetadataMediaDownloadService packageMetadataMediaDownloadService, INuGetFeedVerificationService nuGetFeedVerificationService,
                                     ICommandManager commandManager, IDispatcherService dispatcherService, IRepositoryContextService repositoryService, ITypeFactory typeFactory,
                                     IDefferedPackageLoaderService defferedPackageLoaderService, IPackageOperationContextService packageOperationContextService, INuGetCacheManager nuGetCacheManager,
                                     INuGetConfigurationService nuGetConfigurationService, IDispatcherProviderService dispatcherProviderService)
        {
            Argument.IsNotNull(() => packagesLoaderService);
            Argument.IsNotNull(() => settingsProvider);
            Argument.IsNotNull(() => packageMetadataMediaDownloadService);
            Argument.IsNotNull(() => commandManager);
            Argument.IsNotNull(() => nuGetFeedVerificationService);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => repositoryService);
            Argument.IsNotNull(() => typeFactory);
            Argument.IsNotNull(() => defferedPackageLoaderService);
            Argument.IsNotNull(() => packageOperationContextService);
            Argument.IsNotNull(() => nuGetCacheManager);
            Argument.IsNotNull(() => nuGetConfigurationService);
            Argument.IsNotNull(() => dispatcherProviderService);

            _dispatcherService = dispatcherService;
            _packageMetadataMediaDownloadService = packageMetadataMediaDownloadService;
            _nuGetFeedVerificationService        = nuGetFeedVerificationService;
            _repositoryService              = repositoryService;
            _defferedPackageLoaderService   = defferedPackageLoaderService;
            _packageOperationContextService = packageOperationContextService;
            _typeFactory               = typeFactory;
            _packagesLoaderService     = packagesLoaderService;
            _nuGetCacheManager         = nuGetCacheManager;
            _nuGetConfigurationService = nuGetConfigurationService;
            _dispatcherProviderService = dispatcherProviderService;
            Settings = settingsProvider.Model;

            LoadNextPackagePage = new TaskCommand(LoadNextPackagePageExecuteAsync);
            CancelPageLoading   = new TaskCommand(CancelPageLoadingExecuteAsync);
            RefreshCurrentPage  = new TaskCommand(RefreshCurrentPageExecuteAsync);

            commandManager.RegisterCommand(nameof(RefreshCurrentPage), RefreshCurrentPage, this);

            Title = page.Parameters.Tab.Name;
            _initialSearchParams = page.Parameters.InitialSearchParameters; //if null, standard Settings will not be overriden

            if (Title != "Browse")
            {
#pragma warning disable IDISP004 // Don't ignore created IDisposable.
                _packagesLoaderService = this.GetServiceLocator().ResolveType <IPackageLoaderService>(Title);
#pragma warning restore IDISP004 // Don't ignore created IDisposable.
            }

            if (!Enum.TryParse(Title, out _pageType))
            {
                Log.Error("Unrecognized page type");
            }

            CanBatchProjectActions = _pageType != MetadataOrigin.Installed;

            Page = page;
        }
        public DefferedPackageLoaderService(IRepositoryContextService repositoryService, INuGetPackageManager nuGetExtensibleProjectManager,
                                            IModelProvider <ExplorerSettingsContainer> settingsProvider, IDefaultExtensibleProjectProvider projectProvider)
        {
            Argument.IsNotNull(() => repositoryService);
            Argument.IsNotNull(() => nuGetExtensibleProjectManager);
            Argument.IsNotNull(() => settingsProvider);
            Argument.IsNotNull(() => projectProvider);

            _repositoryService = repositoryService;
            _projectManager    = nuGetExtensibleProjectManager;
            _settignsProvider  = settingsProvider;
            _projectProvider   = projectProvider;
        }
Ejemplo n.º 3
0
        public LocalPackagesLoaderService(IDirectoryService directoryService, IRepositoryContextService repositoryService, IExtensibleProjectLocator extensibleProjectLocator,
                                          INuGetPackageManager nuGetExtensibleProjectManager, ISourceRepositoryProvider repositoryProvider)
        {
            Argument.IsNotNull(() => directoryService);
            Argument.IsNotNull(() => extensibleProjectLocator);
            Argument.IsNotNull(() => nuGetExtensibleProjectManager);
            Argument.IsNotNull(() => repositoryService);

            _extensibleProjectLocator = extensibleProjectLocator;
            _projectManager           = nuGetExtensibleProjectManager;
            _repositoryProvider       = repositoryProvider;
            _directoryService         = directoryService;
            _repositoryService        = repositoryService;
        }
        public V3RestorePackageConfigAndReinstall(IDefaultExtensibleProjectProvider projectProvider, INuGetPackageManager nuGetPackageManager, IRepositoryContextService repositoryContextService,
                                                  ILogger logger, IConfigurationService configurationService, IPackageOperationNotificationService packageOperationNotificationService, IDirectoryService directoryService)
        {
            Argument.IsNotNull(() => projectProvider);
            Argument.IsNotNull(() => nuGetPackageManager);
            Argument.IsNotNull(() => repositoryContextService);
            Argument.IsNotNull(() => configurationService);
            Argument.IsNotNull(() => packageOperationNotificationService);
            Argument.IsNotNull(() => directoryService);

            _defaultProject           = projectProvider.GetDefaultProject();
            _nuGetPackageManager      = nuGetPackageManager;
            _repositoryContextService = repositoryContextService;
            _logger = logger;
            _configurationService = configurationService;
            _packageOperationNotificationService = packageOperationNotificationService;
            _directoryService = directoryService;
        }
        public RepositoryService(IRepositoryContextService repositoryContextService, IExtensibleProjectLocator extensibleProjectLocator,
                                 INuGetPackageManager projectManager, INuGetConfigurationService nuGetConfigurationService,
                                 IDefaultExtensibleProjectProvider defaultExtensibleProjectProvider, ISourceRepositoryProvider repositoryProvider)
        {
            Argument.IsNotNull(() => repositoryContextService);
            Argument.IsNotNull(() => extensibleProjectLocator);
            Argument.IsNotNull(() => projectManager);
            Argument.IsNotNull(() => nuGetConfigurationService);
            Argument.IsNotNull(() => defaultExtensibleProjectProvider);
            Argument.IsNotNull(() => repositoryProvider);

            _repositoryContextService         = repositoryContextService;
            _extensibleProjectLocator         = extensibleProjectLocator;
            _projectManager                   = projectManager;
            _nuGetConfigurationService        = nuGetConfigurationService;
            _defaultExtensibleProjectProvider = defaultExtensibleProjectProvider;
            _repositoryProvider               = repositoryProvider;
            LocalRepository                   = GetMainProjectRepository();
        }