Esempio n. 1
0
        private void InitializeVoiceCommands()
        {
            this.WriteToOutputTextBlock("Initializing system...");

            this.voiceCommandHideTimer          = new DispatcherTimer();
            this.voiceCommandHideTimer.Interval = TimeSpan.FromSeconds(5);
            this.voiceCommandHideTimer.Tick    += this.VoiceCommandHideTimer_Tick;

            this.voiceController = new VoiceCommandController();
            this.voiceController.ResponseReceived += this.VoiceController_ResponseReceived;
            this.voiceController.CommandReceived  += this.VoiceController_CommandReceived;
            this.voiceController.StateChanged     += this.VoiceController_StateChanged;
        }
        public ControllerPage()
        {
            this.InitializeComponent();
            moveButton.IsEnabled = stopButton.IsEnabled = navButton.IsEnabled = false;

            stopwatch = new Stopwatch();
            stopwatch.Start();

            voiceCommandHideTimer          = new DispatcherTimer();
            voiceCommandHideTimer.Interval = TimeSpan.FromSeconds(5);
            voiceCommandHideTimer.Tick    += VoiceCommandHideTimer_Tick;

            controller = new Controller();
            controller.ControllerMessageReceived += Controller_ControllerMessageReceived;

            voiceController = new VoiceCommandController();
            voiceController.ResponseReceived += VoiceController_ResponseReceived;
            voiceController.CommandReceived  += VoiceController_CommandReceived;
            voiceController.StateChanged     += VoiceController_StateChanged;

            InitializeUI();
        }