private void InitializeServices() { _predictionRaportingService = InitializePredictionRaportingService(); _lanaActionService = InitializeLanaActionService(); _cts = new CancellationTokenSource(); _speechListenerTask = InitializeSpeechListener( this._predictionRaportingService, this._lanaActionService, this._cts); DataContext = _predictionRaportingService.PredictionsList; }
private static Task InitializeSpeechListener( IPredictionRaportingService predictionRaportingService, ILanaActionService lanaActionService, CancellationTokenSource cts) { var predictionListeners = InitializePredictionListeners(); var actions = lanaActionService.GetAll(); var speechGrammarProvider = new SpeechGrammarProvider(actions); var _speechListener = new SpeechListener( predictionRaportingService, predictionListeners, speechGrammarProvider ); return(Task.Run(() => _speechListener.Run(cts))); }
public SpeechListener(IPredictionRaportingService predictionRaportingService, IEnumerable <IPredictionListener> predictionListeners, ISpeechGrammarProvider speechGrammarProvider) { this._predictionRaportingService = predictionRaportingService; this._predictionListeners = predictionListeners; this._speechGrammarProvider = speechGrammarProvider; }