static void Main(string[] args) { IServiceProvider provider = BuildServiceProvider(); IAutoCompleteService autocompletionService = provider.GetService <IAutoCompleteService>(); Console.WriteLine("Please enter the example text:"); string text = Console.ReadLine(); if (autocompletionService is IAddableAutocompleteService service) { service.AddTextToSource(text); } Console.WriteLine("Please enter the word to search in text, type \"exit\" to exit the program"); string word = Console.ReadLine(); while (word != "exit") { var suggestions = autocompletionService.GetNextWords(word); if (suggestions != null) { foreach (var suggestion in suggestions.Take(10)) { Console.WriteLine($"{suggestion.frequency} x {suggestion.word}"); } } else { Console.WriteLine("No matches"); } Console.WriteLine("Please enter the word to search in text, type \"exit\" to exit the program"); word = Console.ReadLine(); } }
public MainViewModel(IThePirateBaySource thePirateBaySource, ILogService logger, ILeetxSource leetxSource, IRargbSource rargbSource, IKickassSource kickassSource, TorrentInfoDialogViewModel torrentInfoDialogViewModel, IUserConfiguration userConfiguration, IAutoCompleteService autoCompleteService) { _torrentSourceDictionary = new Dictionary <TorrentSource, SourceInformation>(); _unfilteredTorrentEntries = new List <TorrentEntry>(); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _torrentInfoDialogViewModel = torrentInfoDialogViewModel ?? throw new ArgumentNullException(nameof(torrentInfoDialogViewModel)); _userConfiguration = userConfiguration ?? throw new ArgumentNullException(nameof(userConfiguration)); _autoCompleteService = autoCompleteService; AddTorrentSource(TorrentSource.ThePirateBay, thePirateBaySource, startPage: 0, siteName: "The Pirate Bay"); AddTorrentSource(TorrentSource.Leetx, leetxSource, startPage: 1, siteName: "1337X"); AddTorrentSource(TorrentSource.Kickass, kickassSource, startPage: 1, siteName: "Kickass Torrents"); InitializeViewModel(); LoadSettings(); SetSourceAvailablitiesAsync(); }
public AutoCompleteController(IServiceProvider serviceProvider) { // инициализация менеджеров _autoCompleteManagerLine = IoC.Container.ResolveNamed <IAutoCompleteService>("LineSearch"); _autoComplateManagerBinarySearch = IoC.Container.ResolveNamed <IAutoCompleteService>("BinarySearch"); _autoCompleteManagerTree = IoC.Container.ResolveNamed <IAutoCompleteService>("TreeSearch"); _dataProvider = (IDataProviderService)serviceProvider.GetService(typeof(IDataProviderService)); // Инициализация словарей InitData(); }
public ConsoleInputManager(GameConsole console) { _console = console; _console.Closed += (_, __) => Enabled = false; _console.Opened += (_, __) => Enabled = true; TextEditor = new KeyboardTextEditor(_console.Game.Window); TextEditor.TextSubmitted += CommandEntered; TextEditor.CharHandling += TextEditorTabHandling; TextEditor.TextAdded += (_, __) => UpdateAutoComplete(); TextEditor.TextRemoved += (_, __) => UpdateAutoComplete(); AutoCompleteService = new ConsoleAutoCompleteService(Commands); }
public AddOrphanView() { InitializeComponent(); _AddOrphanViewModel = Program.Factory.Resolve <AddOrphanViewModel>(); _AddOrphanViewModel.CaregiversSelectionListLoad += CaregiverDataLoaded; _AddOrphanViewModel.FamiliesSelectionListLoad += FamiliesDataLoaded; _AddOrphanViewModel.LoadSelectionData(); TranslateControls(); _orphan = new OrphanageDataModel.Persons.Orphan(); _orphan.Name = new OrphanageDataModel.RegularData.Name(); _orphan.Education = new Study() { Stage = Properties.Resources.EducationStageDefaultString }; orphanBindingSource.DataSource = _orphan; orphanNameForm.NameDataSource = _orphan.Name; studyBindingSource.DataSource = _orphan.Education; caregiverBindingSource.DataSource = new OrphanageDataModel.Persons.Caregiver(); caregiverNameForm.NameDataSource = new OrphanageDataModel.RegularData.Name(); caregiverAddressForm.AddressDataSource = new OrphanageDataModel.RegularData.Address(); _entityValidator = Program.Factory.Resolve <IEntityValidator>(); _AutoCompleteServic = Program.Factory.Resolve <IAutoCompleteService>(); _AutoCompleteServic.DataLoaded += _AutoCompleteServic_DataLoaded; radWaitingBar1.StartWaiting(); DisableEnableEducationControls(false); DisableEnableHealthControls(false); radWizard1.FinishButton.Click += FinishButton_Click; radWizard1.CancelButton.Click += FinishButton_Click; }
/// <summary> /// Initializes a new instance of the <see cref="VocabularyReader{T}"/> class. /// </summary> /// <param name="autoCompleteService"> /// The auto complete service. /// </param> /// <param name="converter"> /// The converter. /// </param> public VocabularyReader(IAutoCompleteService <T> autoCompleteService, IWordValueConverter <T> converter) { this.autoCompleteService = autoCompleteService; this.converter = converter; this.testPrefixesList = new List <T>(); }
/// <summary> /// Initializes a new instance of the <see cref="VocabularyWriter{T}"/> class. /// </summary> /// <param name="autoCompleteService"> /// The auto complete service. /// </param> /// <param name="converter"> /// The converter. /// </param> public VocabularyWriter(IAutoCompleteService <T> autoCompleteService, IWordValueConverter <T> converter) { this.autoCompleteService = autoCompleteService; this.converter = converter; }
/// <summary> /// Initializes a new instance of the <see cref="AutoCompleteWcfService"/> class. /// </summary> /// <param name="autoCompleteService"> /// The auto complete service. /// </param> public AutoCompleteWcfService(IAutoCompleteService <string> autoCompleteService) { this.autoCompleteService = autoCompleteService; }
/// <summary> /// Initializes a new instance of the <see cref="AutoCompleteServiceImplementation"/> class. /// </summary> public AutoCompleteServiceImplementation() { this.autoCompleteService = ServiceLocator.Resolve <IAutoCompleteService <string> >(); this.Logger = ServiceLocator.Resolve <ILoggerHelp>().Logger; }
public SearchController(IAutoCompleteService <ProductCategoryResponse> completeService, IProductService productService) { _completeService = completeService; _productService = productService; }
public AutoCompleteController(IAutoCompleteService autocompleteService) { _autocompleteService = autocompleteService; }