public MainWindowViewModel(AutoCompleteBasedOnLucene autoCompleteText, IGetActionsForItem getActionsForItem, Logger log, UpdateManagerAdapter updateManager, IWindowManager windowManager, Shutdown shutdown) { _autoCompleteText = autoCompleteText; _getActionsForItem = getActionsForItem; _log = log; _updateManager = updateManager; _windowManager = windowManager; _shutdown = shutdown; _updateManager.UpdatesAvailable += (sender, args) => { { Status.SetMessage(this, "Update available, downloading"); _updateManager.PrepareUpdates(); } }; _updateManager.UpdatesReady += (sender, args) => { Status.SetMessage(this, "Update prepared, ready for install"); NotifyOfPropertyChange(() => UpdateVisible); NotifyOfPropertyChange(() => CanUpdate); }; _cancelationTokenSource = new CancellationTokenSource(); _argumentCancelationTokenSource = new CancellationTokenSource(); CommandOptions = new ListWithCurrentSelection <AutoCompletionResult.CommandResult>( new AutoCompletionResult.CommandResult(new TextItem(string.Empty), null)); ArgumentOptions = new ListWithCurrentSelection <string>(); Result = CommandOptions.Current; }
private AutoCompleteBasedOnLucene GetAutocompleter(params IItem[] items) { if (items == null) { items = new IItem[] {} } ; var directoryFactory = new StaticDirectoryFactory(_directory); var source = new Source { Items = items }; var sourceStorage = new SourceStorageFactory(directoryFactory, _converterRepository, _learningRepository) { Sources = new[] { source } }; var searcher = new AutoCompleteBasedOnLucene(directoryFactory, sourceStorage, new DebugLogger(), _converterRepository); searcher.Configuration = new AutoCompleteConfiguration(); searcher.Converters = new[] { new TextItemConverter() }; return(searcher); }