Main R editor command controller
Inheritance: Microsoft.Languages.Editor.Controller.ViewController
コード例 #1
0
ファイル: RMainController.cs プロジェクト: xoriath/RTVS
        /// <summary>
        /// Attaches command controller to the view and projected buffer
        /// </summary>
        public static RMainController Attach(ITextView textView, ITextBuffer textBuffer) {
            RMainController controller = FromTextView(textView);
            if (controller == null) {
                controller = new RMainController(textView, textBuffer);
            }

            return controller;
        }
コード例 #2
0
        /// <summary>
        /// Attaches command controller to the view and projected buffer
        /// </summary>
        public static RMainController Attach(ITextView textView, ITextBuffer textBuffer) {
            RMainController controller = FromTextView(textView);
            if (controller == null) {
                controller = new RMainController(textView, textBuffer);
            }

            return controller;
        }
コード例 #3
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);
        }
コード例 #4
0
        protected override void OnTextViewConnected(ITextView textView, ITextBuffer textBuffer)
        {
            RMainController.Attach(textView, textBuffer);

            base.OnTextViewConnected(textView, textBuffer);
        }