/// <summary> /// Triggers if a <see cref="MouseButton"/> is clicked while the <see cref="CodeListBox"/> is focused. /// </summary> /// <param name="sender"> /// The <see cref="object"/> which triggered the event. /// </param> /// <param name="e"> /// The specific <see cref="MouseButtonEventArgs"/>. /// </param> private void CodeListBox_PreviewMouseDown(object sender, MouseButtonEventArgs e) { if (e.ClickCount == 2) { Task.Factory.StartNew(() => Gui.PseudoSenseUserInteraction(CodeTextBox, CodeListBox, RecognitionEngine.PreviousWord), CancellationToken.None, TaskCreationOptions.None, this.scheduler); } }
/// <summary> /// Triggers if a <see cref="Key"/> is pressed while the <see cref="CodeListBox"/> is focused. /// </summary> /// <param name="sender">The <see cref="object"/> which triggered the event.</param> /// <param name="e">The specific <see cref="KeyEventArgs"/>.</param> private void CodeListBox_PreviewKeyDown(object sender, KeyEventArgs e) { Task.Factory.StartNew(() => Gui.PseudoSenseUserInteraction(CodeTextBox, CodeListBox, RecognitionEngine.PreviousWord, e), CancellationToken.None, TaskCreationOptions.None, this.scheduler); }