public CurrentP4kFileSystemViewModel(ICurrentP4k currentP4k,
                                             ICurrentItem currentFile,
                                             IPinnedItems selectedItems,
                                             IExtractP4kContent extractP4KContent,
                                             ISearch search,
                                             ISearchOptions searchOptions,
                                             IUiDispatch uiDispatch,
                                             SearchOptionsViewModel searchOptionsViewModel,
                                             IEnumerable <IFileSubStructureProvider> subFileFactories = null)
        {
            _currentP4K        = currentP4k;
            _currentFile       = currentFile;
            _selectedItems     = selectedItems;
            _extractP4KContent = extractP4KContent;
            _search            = search;
            _searchOptions     = searchOptions;
            _uiDispatch        = uiDispatch;
            _subFileFactories  = subFileFactories != null?subFileFactories.ToArray() : new IFileSubStructureProvider[0];

            SearchOptionsViewModel = searchOptionsViewModel;

            Initialize();

            _currentP4K.Changed += Initialize;
        }
Esempio n. 2
0
        public SearchViewModel(ISearch searchIndex,
                               IUiDispatch uiDispatch,
                               SearchOptionsViewModel searchOptionsViewModel)
        {
            _searchIndex = searchIndex;
            _uiDispatch  = uiDispatch;

            _searchIndex.Began    += ShowSearchIndicator;
            _searchIndex.Finished += HideSearchIndicator;

            FindFilesBySearchTermsCommand  = new RelayCommand(FindFilesBySearchTerms);
            ToggleDetailsVisibilityCommand = new RelayCommand(ToggleDetailsVisibility);
            SearchOptions = searchOptionsViewModel;
        }