Dispose() public method

public Dispose ( ) : void
return void
Example #1
0
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     if (disposing)
     {
         if (!disposed)
         {
             disposed = true;
             if (caret != null)
             {
                 caret.PositionChanged -= new EventHandler(SearchMatchingBracket);
                 caret.Dispose();
             }
             if (selectionManager != null)
             {
                 selectionManager.Dispose();
             }
             Document.TextContentChanged             -= new EventHandler(TextContentChanged);
             Document.FoldingManager.FoldingsChanged -= new EventHandler(DocumentFoldingsChanged);
             motherTextAreaControl   = null;
             motherTextEditorControl = null;
             foreach (AbstractMargin margin in leftMargins)
             {
                 if (margin is IDisposable)
                 {
                     (margin as IDisposable).Dispose();
                 }
             }
             textView.Dispose();
         }
     }
 }
Example #2
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                if (!_disposed)
                {
                    _disposed = true;
                    if (Caret != null)
                    {
                        Caret.PositionChanged -= new EventHandler(SearchMatchingBracket);
                        Caret.Dispose();
                    }

                    if (SelectionManager != null)
                    {
                        SelectionManager.Dispose();
                    }

                    Document.TextContentChanged             -= TextContentChanged;
                    Document.FoldingManager.FoldingsChanged -= DocumentFoldingsChanged;
                    MotherTextAreaControl   = null;
                    MotherTextEditorControl = null;

                    foreach (IMargin margin in _leftMargins)
                    {
                        if (margin is IDisposable)
                        {
                            (margin as IDisposable).Dispose();
                        }
                    }

                    TextView.Dispose();
                }
            }
        }