private void TextEditorKeyUp(object sender, KeyEventArgs e) { if (!(e.Key == Key.Space && Keyboard.Modifiers == ModifierKeys.Control)) { return; } if (e.IsUp) { foreach (var codeCompletionBinding in CodeCompletionBindings.OfType <ICodeCompletionBinding>()) { if (codeCompletionBinding.CtrlSpace(_avalonEditTextEditorAdapter)) { break; } } } e.Handled = true; }
void OnCodeInsight(object sender, ExecutedRoutedEventArgs e) { if (InsightWindow != null) { InsightWindow.Close(); } // disable all code insight bindings when Insight is disabled if (!CodeCompletionOptions.InsightEnabled) { return; } CodeEditorView textEditor = GetTextEditorFromSender(sender); foreach (IInsightCodeCompletionBinding cc in CodeCompletionBindings.OfType <IInsightCodeCompletionBinding>()) { if (cc.CtrlShiftSpace(textEditor.Adapter)) { e.Handled = true; break; } } }