public override void Dispose() { base.Dispose(); StopTimer(); animationStage.ActorStep -= AnimationStage_ActorStep; animationStage.Exeunt(); editor.TextArea.MouseHover -= TextArea_MouseHover; editor.TextArea.MouseLeft -= TextArea_MouseLeft; editor.Caret.PositionChanged -= HandleEditorCaretPositionChanged; editor.Caret.PositionChanged -= EditorCarethandlePositionChanged; editor.Document.FoldTreeUpdated -= HandleEditorDocumentFoldTreeUpdated; layout = layout.Kill(); foldings = null; drawer = null; if (updateAccessibilityId > 0) { GLib.Source.Remove(updateAccessibilityId); updateAccessibilityId = 0; } if (accessibles != null) { foreach (var a in accessibles.Values) { Accessible.RemoveAccessibleChild(a.Accessible); a.Dispose(); } accessibles.Clear(); } }
public FoldMarkerMargin(MonoTextEditor editor) { this.editor = editor; layout = PangoUtil.CreateLayout(editor); editor.Caret.PositionChanged += HandleEditorCaretPositionChanged; editor.Document.FoldTreeUpdated += HandleEditorDocumentFoldTreeUpdated; editor.Caret.PositionChanged += EditorCarethandlePositionChanged; editor.TextArea.MouseHover += TextArea_MouseHover; editor.TextArea.MouseLeft += TextArea_MouseLeft; drawer = new VSCodeFoldMarkerMarginDrawer(this); UpdateAccessibility(); animationStage.ActorStep += AnimationStage_ActorStep; }