/// <summary> /// Handles transitions into and out of dictation mode /// for the focused <see cref="Note"/> control. /// </summary> /// <param name="sender">The <see cref="Note"/> control.</param> /// <param name="e">The event data.</param> private async void TaskPanel_NoteInputModeChanged(object sender, InputModeChangedEventArgs e) { // Transition out of dictation mode. if (_speechManager.RecognitionMode == SpeechRecognitionMode.Dictation && e.NewInputMode != NoteInputMode.Dictation) { if ((bool)VoiceCommandButton.IsChecked) { EnableVoiceCommands(); } else { DisableVoiceCommands(); } } // Transition to dictation mode. else if (_speechManager.RecognitionMode != SpeechRecognitionMode.Dictation && e.NewInputMode == NoteInputMode.Dictation) { await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { if (await _speechManager.SetRecognitionMode(SpeechRecognitionMode.Dictation)) { await _speechManager.SpeakAsync("Dictate your note", _media); } else { e.SourceNote.InputMode = NoteInputMode.Default; } }); } }
private void Note_PropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == "InputMode") { Note note = (Note)sender; InputModeChangedEventArgs args = new InputModeChangedEventArgs(note, note.InputMode); OnNoteInputModeChanged(args); } }
/// <summary> /// Handles transitions into and out of dictation mode /// for the focused <see cref="Note"/> control. /// </summary> /// <param name="noteControl">The <see cref="Note"/> control.</param> /// <param name="e">The event data.</param> private async void taskPanel_NoteInputModeChanged(object sender, InputModeChangedEventArgs e) { // Transition out of dictation mode. if (_speechManager.RecognitionMode == SpeechRecognitionMode.Dictation && e.NewInputMode != NoteInputMode.Dictation) { await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { await _speechManager.SetRecognitionMode(SpeechRecognitionMode.CommandPhrases); }); } // Transition to dictation mode. else if (_speechManager.RecognitionMode != SpeechRecognitionMode.Dictation && e.NewInputMode == NoteInputMode.Dictation) { await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { await _speechManager.SpeakAsync("Dictate your note", _media); await _speechManager.SetRecognitionMode(SpeechRecognitionMode.Dictation); }); } }
private void CanvasControl_NoteInputModeChanged(object sender, InputModeChangedEventArgs e) { OnNoteInputModeChanged(e); }
private void OnNoteInputModeChanged(InputModeChangedEventArgs e) { NoteInputModeChanged?.Invoke(e.SourceNote, e); }
private void Note_InputModeChanged(Note sender, InputModeChangedEventArgs e) { OnNoteInputModeChanged(e); }
/// <summary> /// Handles transitions into and out of dictation mode /// for the focused <see cref="Note"/> control. /// </summary> /// <param name="noteControl">The <see cref="Note"/> control.</param> /// <param name="e">The event data.</param> private async void taskPanel_NoteInputModeChanged(object sender, InputModeChangedEventArgs e) { // Transition out of dictation mode. if (_speechManager.RecognitionMode == SpeechRecognitionMode.Dictation && e.NewInputMode != NoteInputMode.Dictation) { await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { await _speechManager.SetRecognitionMode(SpeechRecognitionMode.CommandPhrases); }); } // Transition to dictation mode. else if (_speechManager.RecognitionMode != SpeechRecognitionMode.Dictation && e.NewInputMode == NoteInputMode.Dictation) { await _dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { await _speechManager.SpeakAsync("Dictate your note", _media); await _speechManager.SetRecognitionMode(SpeechRecognitionMode.Dictation); }); } }