示例#1
0
        public override void Attach(ITextEditor editor)
        {
            if (editor == null)
            {
                return;
            }

            var textEditor = editor.GetService(typeof(TextEditor)) as TextEditor;

            if (textEditor != null)
            {
                pinLayer = new PinLayer(textEditor.TextArea);
                textEditor.TextArea.TextView.InsertLayer(
                    pinLayer,
                    KnownLayer.Caret,
                    LayerInsertionPosition.Above);
            }

            _editor = editor;
            CreatePins(_editor);

            base.Attach(editor);
        }
示例#2
0
 public override void Detach()
 {
     ClosePins(_editor);
     pinLayer = null;
     base.Detach();
 }