Example #1
0
        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);
        }
Example #2
0
        public CodeBrowserViewModel(IServiceProvider serviceProvider, ILog log, IMessageService messageService,
                                    IOptionsService optionsService, IFileProcessor fileProcessor, ISearchMatchService searchMatchService,
                                    IShellSelectionService shellSelectionService, IShellImageService shellImageService)
            : base(KnownFeature.CodeBrowser, serviceProvider)
        {
            _log                   = log;
            _messageService        = messageService;
            _optionsService        = optionsService;
            _fileProcessor         = fileProcessor;
            _searchMatchService    = searchMatchService;
            _shellSelectionService = shellSelectionService;
            _shellImageService     = shellImageService;

            // Source members must be setup in constructor or view won't show any binding data
            _sourceMembers = new ObservableCollection <MemberCodeModel>();
            _members       = new CollectionViewSource {
                Source = _sourceMembers
            };                                                                           // must be ObservableCollection

            this.ShowAllMembersCommand = new RelayCommand(_messageService, OnShowAllMembers, OnCanShowAllMembers);
            this.SelectMemberCommand   = new RelayCommand(_messageService, OnSelectMember, OnCanSelectMember);
        }