public CodeEditorOperations(CodeEditor codeEditor, ICompletionBroker completionBroker, ICodeAidProvider codeAidProvider) { this.editorElement = codeEditor.Element; this.editorOperations = codeEditor.EditorCommands; this.undoHistory = codeEditor.UndoHistory; this.textView = codeEditor.TextView; this.completionBroker = completionBroker; this.codeAidEngine = new XamlCodeAidEngine(codeEditor.TextBuffer, codeAidProvider, codeEditor.Environment); this.editorElement.TextInput += new TextCompositionEventHandler(this.OnTextInput); this.editorElement.KeyDown += new KeyEventHandler(this.OnKeyDown); this.editorElement.MouseDown += new MouseButtonEventHandler(this.OnMouseDown); this.undoHistory.UndoRedoHappened += new EventHandler <UndoRedoEventArgs>(this.OnUndoRedoHappened); TextCompositionManager.AddTextInputStartHandler((DependencyObject)this.editorElement, new TextCompositionEventHandler(this.OnTextInputStart)); TextCompositionManager.AddTextInputUpdateHandler((DependencyObject)this.editorElement, new TextCompositionEventHandler(this.OnTextInputUpdate)); }