public SaveDirectoryEntryCommand(IPromptService promptService, IServiceProvider serviceProvider, IBackgroundTaskService backgroundTaskService, ILoggerFactory loggerFactory)
 {
     _logger                = (loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory))).CreateLogger(this.GetType());
     _promptService         = promptService ?? throw new ArgumentNullException(nameof(promptService));
     _serviceProvider       = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     _backgroundTaskService = backgroundTaskService ?? throw new ArgumentNullException(nameof(backgroundTaskService));
 }
Esempio n. 2
0
        public MainViewModel(IPromptService promptService, 
            IEventAggregator eventAggregator,
            Func<FileSelectionViewModel> fileSelectionViewModelfactory,
            Func<OkCancelPanelViewModel> okCancelViewModelfactory)
        {
            string selectedPath = null;
            SelectFilesCommand = new DelegateCommand<object>(o =>
                {
                    selectedPath = promptService.ShowFolderBrowserDialogue();
                    if (string.IsNullOrEmpty(selectedPath)) return;
                    FileSelection = fileSelectionViewModelfactory();
                    FileSelection.LoadFiles(selectedPath);
                    OkCancelPanel = okCancelViewModelfactory();
                });

            eventAggregator.Subscribe<CleanUpFilesMessage>(this, message =>
                {
                    try
                    {
                        if(FileSelection == null) return;
                        FileSelection.CleanUpFiles(selectedPath);
                    }
                    catch (UnauthorizedAccessException exception)
                    {
                        var errorMessage = string.Format("Failed to clean up files. {0} " +
                                                         "This may be due to the file being marked as 'Read Only'",
                                                          exception.Message);
                        promptService.ShowError(errorMessage);
                    }
                    ClearFileSelection();
                });

            eventAggregator.Subscribe<ClearFileSelectionMessage>(this, message =>
                ClearFileSelection());
        }
 public UpgradeCommand(
     IPromptService promptService,
     ISitefinityPackageManager sitefinityPackageManager,
     ICsProjectFileEditor csProjectFileEditor,
     ILogger <UpgradeCommand> logger,
     IProjectConfigFileEditor projectConfigFileEditor,
     IVisualStudioWorker visualStudioWorker)
 {
     this.promptService            = promptService;
     this.sitefinityPackageManager = sitefinityPackageManager;
     this.csProjectFileEditor      = csProjectFileEditor;
     this.logger                           = logger;
     this.visualStudioWorker               = visualStudioWorker;
     this.projectConfigFileEditor          = projectConfigFileEditor;
     this.processedPackagesPerProjectCache = new Dictionary <string, HashSet <string> >();
 }
        public void Initialize()
        {
            var services = new ServiceCollection();

            services.AddHttpClient();
            services.AddTransient <ICsProjectFileEditor, CsProjectFileEditor>();
            services.AddTransient <INuGetApiClient, NuGetApiClient>();
            services.AddTransient <INuGetCliClient, NuGetCliClient>();
            services.AddTransient <IPackagesConfigFileEditor, PackagesConfigFileEditor>();
            services.AddTransient <IProjectConfigFileEditor, ProjectConfigFileEditor>();
            services.AddTransient <ISitefinityPackageManager, SitefinityPackageManager>();
            services.AddSingleton <IVisualStudioWorker, VisualStudioWorker>();
            services.AddSingleton <IPromptService, PromptServiceMock>();

            this.serviceProvider = services.BuildServiceProvider();

            this.sitefinityPackageManager = serviceProvider.GetService <ISitefinityPackageManager>();
            this.csProjectFileEditor      = serviceProvider.GetService <ICsProjectFileEditor>();
            this.logger = serviceProvider.GetService <ILogger <UpgradeCommand> >();
            this.projectConfigFileEditor = serviceProvider.GetService <IProjectConfigFileEditor>();
            this.visualStudioWorker      = serviceProvider.GetService <IVisualStudioWorker>();
            this.promptService           = serviceProvider.GetService <IPromptService>();
        }
Esempio n. 5
0
 public PromptController(IPromptService promptService)
 {
     _promptService = promptService;
 }
Esempio n. 6
0
 public MiscActionProvider(WindowsExplorerHelper windowsExplorerHelper, IPromptService promptService)
 {
     this._windowsExplorerHelper = windowsExplorerHelper;
     this._promptService         = promptService;
 }
Esempio n. 7
0
 public PromptsController(IMapper mapper, IHttpContextAccessor httpContextAccessor, IPromptService promptService)
 {
     _mapper = mapper;
     _httpContextAccessor = httpContextAccessor;
     _promptService       = promptService;
 }
 public UpgradeCommandSut(IPromptService promptService, ISitefinityPackageManager sitefinityPackageManager, ICsProjectFileEditor csProjectFileEditor, ILogger <UpgradeCommand> logger, IProjectConfigFileEditor projectConfigFileEditor, IVisualStudioWorker visualStudioWorker)
     : base(promptService, sitefinityPackageManager, csProjectFileEditor, logger, projectConfigFileEditor, visualStudioWorker)
 {
 }
Esempio n. 9
0
 public MiscActionProvider(WindowsExplorerHelper windowsExplorerHelper, IPromptService promptService)
 {
     this._windowsExplorerHelper = windowsExplorerHelper;
     this._promptService = promptService;
 }
Esempio n. 10
0
 public ErrorHandler(ILogger logger, IPromptService promptService)
 {
     _logger = logger;
     _promptService = promptService;
 }