コード例 #1
0
        private void InitializeServices()
        {
            _predictionRaportingService = InitializePredictionRaportingService();
            _lanaActionService          = InitializeLanaActionService();

            _cts = new CancellationTokenSource();
            _speechListenerTask = InitializeSpeechListener(
                this._predictionRaportingService,
                this._lanaActionService,
                this._cts);

            DataContext = _predictionRaportingService.PredictionsList;
        }
コード例 #2
0
        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)));
        }
コード例 #3
0
 public SpeechListener(IPredictionRaportingService predictionRaportingService, IEnumerable <IPredictionListener> predictionListeners, ISpeechGrammarProvider speechGrammarProvider)
 {
     this._predictionRaportingService = predictionRaportingService;
     this._predictionListeners        = predictionListeners;
     this._speechGrammarProvider      = speechGrammarProvider;
 }