Attach() public static method

Attaches command controller to the view and projected buffer
public static Attach ( ITextView textView, ITextBuffer textBuffer, ICoreShell shell ) : RMainController
textView ITextView
textBuffer ITextBuffer
shell ICoreShell
return RMainController
Exemplo n.º 1
0
        protected override void OnTextViewConnected(ITextView textView, ITextBuffer textBuffer)
        {
            var mainController = RMainController.Attach(textView, textBuffer, Services);

            if (textBuffer != textView.TextBuffer)
            {
                // Projected scenario
                _containedLanguageHost = textBuffer.GetService <IContainedLanguageHost>();
                if (_containedLanguageHost != null)
                {
                    _containedLanguageHost.Closing += OnContainedLanguageHostClosing;
                    _textBuffer = textBuffer;

                    var nextTarget = _containedLanguageHost.SetContainedCommandTarget(textView.ToEditorView(), mainController);
                    // Convert chained target to ICommandTarget (chained target might be IOleCommandTarget and host will create a shim then).
                    mainController.ChainedController = nextTarget;
                }
            }
            base.OnTextViewConnected(textView, textBuffer);
        }
Exemplo n.º 2
0
        protected override void OnTextViewConnected(ITextView textView, ITextBuffer textBuffer)
        {
            RMainController.Attach(textView, textBuffer);

            base.OnTextViewConnected(textView, textBuffer);
        }