Esempio n. 1
0
        public MainViewModel(IPackagesUIService packagesUiService, IEchoService echoService, INuGetConfigurationService nuGetConfigurationService,
                             INuGetFeedVerificationService feedVerificationService, IMessageService messageService, IPackagesUpdatesSearcherService packagesUpdatesSearcherService,
                             IPackageBatchService packageBatchService, IUIVisualizerService uiVisualizerService)
        {
            Argument.IsNotNull(() => packagesUiService);
            Argument.IsNotNull(() => echoService);
            Argument.IsNotNull(() => nuGetConfigurationService);
            Argument.IsNotNull(() => feedVerificationService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => packageBatchService);
            Argument.IsNotNull(() => uiVisualizerService);

            _packagesUiService              = packagesUiService;
            _nuGetConfigurationService      = nuGetConfigurationService;
            _feedVerificationService        = feedVerificationService;
            _messageService                 = messageService;
            _packagesUpdatesSearcherService = packagesUpdatesSearcherService;
            _packageBatchService            = packageBatchService;
            _uiVisualizerService            = uiVisualizerService;

            Echo = echoService.GetPackageManagementEcho();

            AvailableUpdates = new ObservableCollection <IPackageDetails>();

            ShowExplorer      = new Command(OnShowExplorerExecute);
            AdddPackageSource = new TaskCommand(OnAdddPackageSourceExecute, OnAdddPackageSourceCanExecute);
            VerifyFeed        = new TaskCommand(OnVerifyFeedExecute, OnVerifyFeedCanExecute);
            CheckForUpdates   = new TaskCommand(OnCheckForUpdatesExecute);
            OpenUpdateWindow  = new TaskCommand(OnOpenUpdateWindowExecute, OnOpenUpdateWindowCanExecute);
            Settings          = new TaskCommand(OnSettingsExecute);
        }
        public MainViewModel(IPackagesUIService packagesUiService, IEchoService echoService, INuGetConfigurationService nuGetConfigurationService,
            INuGetFeedVerificationService feedVerificationService, IMessageService messageService, IPackagesUpdatesSearcherService packagesUpdatesSearcherService,
            IPackageBatchService packageBatchService, IUIVisualizerService uiVisualizerService)
        {
            Argument.IsNotNull(() => packagesUiService);
            Argument.IsNotNull(() => echoService);
            Argument.IsNotNull(() => nuGetConfigurationService);
            Argument.IsNotNull(() => feedVerificationService);
            Argument.IsNotNull(() => messageService);
            Argument.IsNotNull(() => packageBatchService);
            Argument.IsNotNull(() => uiVisualizerService);

            _packagesUiService = packagesUiService;
            _nuGetConfigurationService = nuGetConfigurationService;
            _feedVerificationService = feedVerificationService;
            _messageService = messageService;
            _packagesUpdatesSearcherService = packagesUpdatesSearcherService;
            _packageBatchService = packageBatchService;
            _uiVisualizerService = uiVisualizerService;

            Echo = echoService.GetPackageManagementEcho();

            AvailableUpdates = new ObservableCollection<IPackageDetails>();

            ShowExplorer = new Command(OnShowExplorerExecute);
            AdddPackageSource = new TaskCommand(OnAdddPackageSourceExecute, OnAdddPackageSourceCanExecute);
            VerifyFeed = new TaskCommand(OnVerifyFeedExecute, OnVerifyFeedCanExecute);
            CheckForUpdates = new TaskCommand(OnCheckForUpdatesExecute);
            OpenUpdateWindow = new TaskCommand(OnOpenUpdateWindowExecute, OnOpenUpdateWindowCanExecute);
            Settings = new TaskCommand(OnSettingsExecute);
        }
        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;
        }
Esempio n. 4
0
        public PackageSourceSettingViewModel(INuGetFeedVerificationService nuGetFeedVerificationService, IPackageSourceFactory packageSourceFactory)
        {
            Argument.IsNotNull(() => nuGetFeedVerificationService);
            Argument.IsNotNull(() => packageSourceFactory);

            _nuGetFeedVerificationService = nuGetFeedVerificationService;
            _packageSourceFactory         = packageSourceFactory;

            Add      = new Command(OnAddExecute);
            Remove   = new Command(OnRemoveExecute, OnRemoveCanExecute);
            MoveUp   = new Command(OnMoveUpExecute, OnMoveUpCanExecute);
            MoveDown = new Command(OnMoveDownExecute, OnMoveDownCanExecute);
        }
        public NuGetConfigurationService(IConfigurationService configurationService, IPackageSourceProvider packageSourceProvider,
            INuGetFeedVerificationService feedVerificationService)
        {
            Argument.IsNotNull(() => configurationService);
            Argument.IsNotNull(() => packageSourceProvider);
            Argument.IsNotNull(() => feedVerificationService);

            _configurationService = configurationService;
            _packageSourceProvider = packageSourceProvider;
            _feedVerificationService = feedVerificationService;

            var applicationDataDirectory = Path.GetApplicationDataDirectory();
            _defaultDestinationFolder = Path.Combine(applicationDataDirectory, "plugins");
        }
        public NuGetConfigurationService(IConfigurationService configurationService, IPackageSourceProvider packageSourceProvider,
                                         INuGetFeedVerificationService feedVerificationService)
        {
            Argument.IsNotNull(() => configurationService);
            Argument.IsNotNull(() => packageSourceProvider);
            Argument.IsNotNull(() => feedVerificationService);

            _configurationService    = configurationService;
            _packageSourceProvider   = packageSourceProvider;
            _feedVerificationService = feedVerificationService;

            var applicationDataDirectory = Path.GetApplicationDataDirectory();

            _defaultDestinationFolder = Path.Combine(applicationDataDirectory, "plugins");
        }
        public PackageSourceSettingViewModel(INuGetFeedVerificationService nuGetFeedVerificationService, IPackageSourceFactory packageSourceFactory)
        {
            Argument.IsNotNull(() => nuGetFeedVerificationService);
            Argument.IsNotNull(() => packageSourceFactory);

            _nuGetFeedVerificationService = nuGetFeedVerificationService;
            _packageSourceFactory = packageSourceFactory;

            Add = new Command(OnAddExecute);
            Remove = new Command(OnRemoveExecute, OnRemoveCanExecute);
            MoveUp = new Command(OnMoveUpExecute, OnMoveUpCanExecute);
            MoveDown = new Command(OnMoveDownExecute, OnMoveDownCanExecute);

            SuspendValidation = false;
        }
Esempio n. 8
0
        public PackageSourceSettingViewModel(INuGetConfigurationService configurationService, INuGetFeedVerificationService feedVerificationService)
        {
            Argument.IsNotNull(() => configurationService);
            Argument.IsNotNull(() => feedVerificationService);

            _configurationService    = configurationService;
            _feedVerificationService = feedVerificationService;

            RemovedFeeds = new List <NuGetFeed>();

            DeferValidationUntilFirstSaveCall = true;

            DefaultFeed       = Constants.DefaultNuGetOrgUri;
            DefaultSourceName = Constants.DefaultNuGetOrgName;

            SettingsFeeds = new List <NuGetFeed>();
            Feeds         = new ObservableCollection <NuGetFeed>();

            Title = "Settings";

            InitializeCommands();
        }
Esempio n. 9
0
 public PackageSourceSettingViewModel(INuGetConfigurationService configurationService, INuGetFeedVerificationService feedVerificationService, INuGetConfigurationResetService nuGetConfigurationResetService)
     : this(configurationService, feedVerificationService)
 {
     Argument.IsNotNull(() => nuGetConfigurationResetService);
     _nuGetConfigurationResetService = nuGetConfigurationResetService;
 }