Esempio n. 1
0
        private void btnMic_Click(object sender, EventArgs e)
        {
            if (_dictation != null)
            {
                _dictation.Dispose();
            }

            _dictation = new Dictation();
            SetEvents();
            _dictation.Start();
        }
Esempio n. 2
0
        private void btnWavFile_Click(object sender, EventArgs e)
        {
            if (_dictation != null)
            {
                _dictation.Dispose();
            }

            _dictation = new Dictation();
            SetEvents();
            _dictation.Start("example.wav");
        }
        public DictationState()
        {
            inputsim = SharedObjectsSingleton.Instance().inputSimulator;
            toast    = SharedFormsSingleton.Instance().ToastOverlay;

            if (SettingsSingleton.Instance().DragonEnabled)
            {
                dictation = new DragonDictation();
            }
            else
            {
                dictation = new WindowsDictation();
            }
            Settings.Default.PropertyChanged += CheckState;
        }
 // Checks if the dictation class is still of the correct type, and changes it if requiered
 public void CheckState(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     if (e.PropertyName != "DragonEnabled")
     {
         return;
     }
     if (Settings.Default.DragonEnabled && dictation.GetType() == typeof(WindowsDictation))
     {
         dictation.Dispose();
         dictation = new DragonDictation();
     }
     else if (!Settings.Default.DragonEnabled && dictation.GetType() == typeof(DragonDictation))
     {
         dictation.Dispose();
         dictation = new WindowsDictation();
     }
 }