Ejemplo n.º 1
0
        protected override void OnTextBufferCreated(ITextView textView, ITextBuffer textBuffer)
        {
            var clh = ContainedLanguageHost.GetHost(textView, textBuffer, _coreShell);

            OleControllerChain.InitEditorInstance(textBuffer, _coreShell.Services);
            base.OnTextBufferCreated(textView, textBuffer);
        }
Ejemplo n.º 2
0
        protected override void OnTextBufferCreated(ITextBuffer textBuffer)
        {
            // Force creations
            var appShell = VsAppShell.Current;

            OleControllerChain.InitEditorInstance(textBuffer);
            base.OnTextBufferCreated(textBuffer);
        }
Ejemplo n.º 3
0
        protected override void OnTextBufferCreated(ITextView textView, ITextBuffer textBuffer)
        {
            var clh = ContainedLanguageHost.GetHost(textView, textBuffer, Services);

            VsAppShell.EnsurePackageLoaded(RGuidList.RPackageGuid);
            OleControllerChain.InitEditorInstance(textBuffer, Services);
            base.OnTextBufferCreated(textView, textBuffer);
        }
Ejemplo n.º 4
0
 protected override void OnTextViewDisconnected(ITextView textView, ITextBuffer textBuffer)
 {
     if (textBuffer == textView.TextDataModel.DocumentBuffer && _oleController != null)
     {
         OleControllerChain.DisconnectController(_adapterService, textView, _oleController);
         _oleController = null;
     }
     base.OnTextViewDisconnected(textView, textBuffer);
 }
        protected override void OnTextBufferCreated(ITextView textView, ITextBuffer textBuffer)
        {
            // Force creations
            var appShell = VsAppShell.Current;
            var clh      = ContainedLanguageHost.GetHost(textView, textBuffer, appShell);

            OleControllerChain.InitEditorInstance(textBuffer);
            base.OnTextBufferCreated(textView, textBuffer);
        }
Ejemplo n.º 6
0
        protected override void OnTextViewGotAggregateFocus(ITextView textView, ITextBuffer textBuffer)
        {
            bool isProjected = (textBuffer != textView.TextDataModel.DocumentBuffer);

            // Only attach controllers if the document is editable
            if (!isProjected && textView.Roles.Contains(PredefinedTextViewRoles.Editable))
            {
                // Check if another buffer already attached a command controller to the view.
                // Don't allow two to be attached, or commands could be run twice.
                // This currently can only happen with inline diff views.
                RMainController mainController = RMainController.FromTextView(textView);
                if (textBuffer == mainController?.TextBuffer)
                {
                    // Connect main controller to VS text view filter chain.
                    OleControllerChain.ConnectController(_adapterService, textView, mainController);
                }
            }
            base.OnTextViewGotAggregateFocus(textView, textBuffer);
        }
Ejemplo n.º 7
0
        protected override void OnTextViewGotAggregateFocus(ITextView textView, ITextBuffer textBuffer)
        {
            // Only attach controllers if the document is editable
            if (textView.Roles.Contains(PredefinedTextViewRoles.Editable))
            {
                // Check if another buffer already attached a command controller to the view.
                // Don't allow two to be attached, or commands could be run twice.
                // This currently can only happen with inline diff views.
                var mainController = MdMainController.FromTextView(textView);
                if (textBuffer == mainController.TextBuffer)
                {
                    // Connect main controller to VS text view filter chain. The chain looks like
                    // VS IDE -> HTML main controller -> Core editor
                    // However, IDE wants IOleCommandTarget and core editor, although managed,
                    // is represented by OLE command target as well. Since HTML controller
                    // is not specific to VS and does not use OLE, we create OLE-to-managed target shim
                    // and managed target-to-OLE shims.
                    OleControllerChain.ConnectController(Services, textView, mainController);
                }
            }

            base.OnTextViewGotAggregateFocus(textView, textBuffer);
        }
Ejemplo n.º 8
0
 protected override void OnTextBufferCreated(ITextView textView, ITextBuffer textBuffer)
 {
     VsAppShell.EnsurePackageLoaded(MdGuidList.MdPackageGuid);
     OleControllerChain.InitEditorInstance(textBuffer, Services);
     base.OnTextBufferCreated(textView, textBuffer);
 }
 protected override void OnTextBufferCreated(ITextView textView, ITextBuffer textBuffer)
 {
     OleControllerChain.InitEditorInstance(textBuffer, Services);
     base.OnTextBufferCreated(textView, textBuffer);
 }