public void Detach()
 {
     codeManipulation.Dispose();
     if (inspectionManager != null)
     {
         inspectionManager.Dispose();
         inspectionManager = null;
     }
     if (contextActionProviders != null)
     {
         editor.ContextActionProviders.RemoveAll(contextActionProviders.Contains);
     }
     renderer.Dispose();
     this.editor = null;
 }
        public void Detach()
        {
            var textEditor = editor.GetService <TextEditor>();

            if (textEditor != null)
            {
                var textView = textEditor.TextArea.TextView;
                // Unregister our ITextEditorOptions instance from editor
                var optionsService = textView.GetService <ITextEditorOptions>();
                if ((optionsService != null) && (optionsService == options))
                {
                    textView.Services.RemoveService(typeof(ITextEditorOptions));
                }
                // Reset TextEditor options, too?
                if ((textEditor.Options != null) && (textEditor.Options == options.TextEditorOptions))
                {
                    textEditor.Options = originalEditorOptions;
                }
            }

            codeManipulation.Dispose();

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

            if (contextActionProviders != null)
            {
                editor.ContextActionProviders.RemoveAll(contextActionProviders.Contains);
            }

            renderer.Dispose();
            options     = null;
            this.editor = null;
        }
 public override void Detach()
 {
     codeManipulation.Dispose();
 }