Esempio n. 1
0
 private void CheckBox_ListenActive(object sender, System.Windows.RoutedEventArgs e)
 {
     if (DCM.ListenActive)
     {
         VoiceRecognitionManager.Start();
     }
     else
     {
         VoiceRecognitionManager.Stop();
     }
 }
Esempio n. 2
0
        public listen()
        {
            InitializeComponent();
            VoiceRecognitionManager.InitializeSystemSpeech();
            DataContext = DCM;
            Task.Run(async() =>
            {
                VoiceRecognitionManager.Start();
                await Task.Delay(1000);
                CheckBox_ListenActive(null, null);
            });

            for (int i = 0; i < charaCombo.Items.Count; i++)
            {
                var item = charaCombo.Items[i] as ComboBoxItem;
                if (item.DataContext.ToString() == DCM.selectedCharaName)
                {
                    charaCombo.SelectedIndex = i;
                }
            }
        }