コード例 #1
0
ファイル: FileBrowserViewModel.cs プロジェクト: LaggAt/dpack
        public FileBrowserViewModel(IServiceProvider serviceProvider, ILog log, IMessageService messageService,
                                    IOptionsService optionsService, ISolutionProcessor solutionProcessor, IFileTypeResolver fileTypeResolver,
                                    ISearchMatchService searchMatchService, IShellHelperService shellHelperService,
                                    IShellImageService shellImageService, IUtilsService utilsService, IFeatureFactory featureFactory)
            : base(KnownFeature.FileBrowser, serviceProvider)
        {
            _log                = log;
            _messageService     = messageService;
            _optionsService     = optionsService;
            _solutionProcessor  = solutionProcessor;
            _fileTypeResolver   = fileTypeResolver;
            _searchMatchService = searchMatchService;
            _shellHelperService = shellHelperService;
            _shellImageService  = shellImageService;
            _utilsService       = utilsService;
            _featureFactory     = featureFactory;

            // Source files must be setup in constructor or view won't show any binding data
            _sourceFiles = new ObservableCollection <FileModel>();
            _files       = new CollectionViewSource {
                Source = _sourceFiles
            };                                                                       // must be ObservableCollection

            this.ShowFilesCommand                 = new RelayCommand(_messageService, OnShowAllFiles);
            this.OpenCodeBrowserAllCommand        = new RelayCommand(_messageService, OnOpenCodeBrowserAll, OnCanOpenCodeBrowser);
            this.OpenCodeBrowserClassesCommand    = new RelayCommand(_messageService, OnOpenCodeBrowserClasses, OnCanOpenCodeBrowser);
            this.OpenCodeBrowserMethodsCommand    = new RelayCommand(_messageService, OnOpenCodeBrowserMethods, OnCanOpenCodeBrowser);
            this.OpenCodeBrowserPropertiesCommand = new RelayCommand(_messageService, OnOpenCodeBrowserProperties, OnCanOpenCodeBrowser);
            this.OpenFilesCommand                 = new RelayCommand(_messageService, OnOpenFiles, OnCanOpenFiles);
        }
コード例 #2
0
ファイル: FixerRunner.cs プロジェクト: tolltech/tollennobler
        private static async Task <bool> RunCoreAsync(
            ISettings settings,
            IFixer[] fixers,
            ISolutionProcessor solutionProcessor
            )
        {
            try
            {
                var success = await solutionProcessor.ProcessAsync(settings.SolutionPath, fixers);

                if (!success)
                {
                    log.Error("Some changes weren't applied");
                }
                else
                {
                    log.Info("All changes were applied!");
                }

                return(success);
            }
            catch (Exception ex)
            {
                log.Error(ex, "Something went wrong");

                return(false);
            }
        }