示例#1
0
 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);
     }
 }
示例#2
0
 /// <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);
         });
     }
 }
示例#3
0
 private void Note_InputModeChanged(Note sender, InputModeChangedEventArgs e)
 {
     OnNoteInputModeChanged(e);
 }
示例#4
0
 protected void OnNoteInputModeChanged(InputModeChangedEventArgs e)
 {
     NoteInputModeChanged?.Invoke(e.SourceNote, e);
 }
示例#5
0
 private void CanvasControl_NoteInputModeChanged(object sender, InputModeChangedEventArgs e)
 {
     OnNoteInputModeChanged(e);
 }