public PathViewModel(
            LoadedIndexViewModel loadedIndexViewModel,
            string path)
        {
            this.loadedIndexViewModel = loadedIndexViewModel;
            this.path = path;

            RemoveCommand = new RelayCommand(OnRemove);
        }
        private void OnLoadIndex()
        {
            var indexDescriptor = SelectedIndex;
            var index           = new Index(indexDescriptor.Path, false);

            mainViewModel.AddLogEntry("Loaded index: " + indexDescriptor.Path);

            var viewModel = new LoadedIndexViewModel(mainViewModel, indexDescriptor.Name, index);

            mainViewModel.CurrentViewModel = viewModel;
        }
示例#3
0
        private void OnApply()
        {
            var path            = InMemoryIndex ? "<In Memory>" : Folder;
            var indexDescriptor = new IndexDescriptorViewModel(Name, path);

            if (!InMemoryIndex)
            {
                mainViewModel.Settings.Indexes.Add(indexDescriptor);
            }
            var index = CreateIndex();

            mainViewModel.AddLogEntry("Created index: " + indexDescriptor.Path);

            var viewModel = new LoadedIndexViewModel(mainViewModel, indexDescriptor.Name, index);

            mainViewModel.CurrentViewModel = viewModel;
        }
示例#4
0
        public SearchOptionsViewModel(LoadedIndexViewModel loadedIndexViewModel)
        {
            this.loadedIndexViewModel = loadedIndexViewModel;

            IncreaseFuzzyMistakesCommand = new RelayCommand(() =>
            {
                FuzzySearchMaxMistakeCount++;
            }, () =>
            {
                return(FuzzySearchMaxMistakeCount < 10);
            });

            DecreaseFuzzyMistakesCommand = new RelayCommand(() =>
            {
                FuzzySearchMaxMistakeCount--;
            }, () =>
            {
                return(FuzzySearchMaxMistakeCount > 1);
            });

            IncreaseCorrectorMistakesCommand = new RelayCommand(() =>
            {
                SpellingCorrectorMaxMistakeCount++;
            }, () =>
            {
                return(SpellingCorrectorMaxMistakeCount < 10);
            });

            DecreaseCorrectorMistakesCommand = new RelayCommand(() =>
            {
                SpellingCorrectorMaxMistakeCount--;
            }, () =>
            {
                return(SpellingCorrectorMaxMistakeCount > 1);
            });

            searchOptions = new SearchOptions();
            searchOptions.FuzzySearch.FuzzyAlgorithm = new TableDiscreteFunction(2);
            searchOptions.MaxTotalOccurrenceCount    = 100000000;
            searchOptions.MaxOccurrenceCountPerTerm  = 100000000;
        }
 public FoundDocumentViewModel(LoadedIndexViewModel index, FoundDocument result)
 {
     this.index  = index;
     this.result = result;
 }