protected virtual void Dispose(bool isDisposing) { if (!isDisposing) { return; } if (this.editorElement != null) { TextCompositionManager.RemoveTextInputStartHandler((DependencyObject)this.editorElement, new TextCompositionEventHandler(this.OnTextInputStart)); TextCompositionManager.RemoveTextInputUpdateHandler((DependencyObject)this.editorElement, new TextCompositionEventHandler(this.OnTextInputUpdate)); this.editorElement.TextInput -= new TextCompositionEventHandler(this.OnTextInput); this.editorElement.KeyDown -= new KeyEventHandler(this.OnKeyDown); this.editorElement.MouseDown -= new MouseButtonEventHandler(this.OnMouseDown); this.editorElement = (FrameworkElement)null; } if (this.codeAidEngine != null) { this.codeAidEngine.Dispose(); this.codeAidEngine = (XamlCodeAidEngine)null; } if (this.undoHistory == null) { return; } this.undoHistory.UndoRedoHappened -= new EventHandler <UndoRedoEventArgs>(this.OnUndoRedoHappened); this.undoHistory = (UndoHistory)null; }