예제 #1
0
        int IVsFindTarget.GetCapabilities(bool[] pfImage, uint[] pgrfOptions)
        {
            IVsFindTarget vsFindTarget = GetView(sourceFrame) as IVsFindTarget;

            if (vsFindTarget != null)
            {
                return(vsFindTarget.GetCapabilities(pfImage, pgrfOptions));
            }

            if (pfImage != null && pfImage.Length > 0)
            {
                pfImage[0] = true;
            }

            if (pgrfOptions != null && pgrfOptions.Length > 0)
            {
                pgrfOptions[0]  = (uint)__VSFINDOPTIONS.FR_ActionMask;
                pgrfOptions[0] |= (uint)__VSFINDOPTIONS.FR_SyntaxMask;
                pgrfOptions[0] |= (uint)__VSFINDOPTIONS.FR_CommonOptions;
                pgrfOptions[0] |= (uint)__VSFINDOPTIONS.FR_Selection;
                pgrfOptions[0] |= (uint)__VSFINDOPTIONS.FR_Backwards;
            }

            return(VSConstants.S_OK);
        }
예제 #2
0
        int IVsFindTarget.MarkSpan(TextSpan[] pts)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.MarkSpan(pts));
            }
            return(VSConstants.E_NOTIMPL);
        }
예제 #3
0
        protected override void OnCreate()
        {
            _window = _componentModel.GetService <IInteractiveWindowFactoryService>().CreateWindow(_evaluator);
            _window.SubmissionBufferAdded += SubmissionBufferAdded;
            _textViewHost = _window.GetTextViewHost();
            var viewAdapter = _editorAdapters.GetViewAdapter(_textViewHost.TextView);

            _findTarget    = viewAdapter as IVsFindTarget;
            _commandTarget = viewAdapter as IOleCommandTarget;
        }
예제 #4
0
        public void SetFindTarget(object findTarget)
        {
            IVsFindTarget ft = (findTarget as IVsFindTarget);

            if (null == ft)
            {
                throw new ArgumentNullException("findTarget");
            }

            _instance.SetFindTarget(ft);
        }
예제 #5
0
        int IVsFindTarget.NotifyFindTarget(uint notification)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.NotifyFindTarget(notification));
            }

            return(VSConstants.S_OK);
        }
예제 #6
0
        int IVsFindTarget.SetFindState(object pUnk)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.SetFindState(pUnk));
            }

            return(VSConstants.E_NOTIMPL);
        }
예제 #7
0
        int IVsFindTarget.GetMatchRect(Microsoft.VisualStudio.OLE.Interop.RECT[] prc)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.GetMatchRect(prc));
            }

            return(VSConstants.E_NOTIMPL);
        }
예제 #8
0
        int IVsFindTarget.GetSearchImage(uint grfOptions, IVsTextSpanSet[] ppSpans, out IVsTextImage ppTextImage)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.GetSearchImage(grfOptions, ppSpans, out ppTextImage));
            }
            ppTextImage = null;
            return(VSConstants.E_NOTIMPL);
        }
예제 #9
0
        int IVsFindTarget.Find(string pszSearch, uint grfOptions, int fResetStartPoint, IVsFindHelper pHelper, out uint pResult)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.Find(pszSearch, grfOptions, fResetStartPoint, pHelper, out pResult));
            }

            pResult = (uint)__VSFINDRESULT.VSFR_NotFound;
            return(VSConstants.E_NOTIMPL);
        }
예제 #10
0
        int IVsFindTarget.GetProperty(uint propid, out object pvar)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.GetProperty(propid, out pvar));
            }

            pvar = null;
            return(VSConstants.E_NOTIMPL);
        }
예제 #11
0
        int IVsFindTarget.GetFindState(out object ppunk)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.GetFindState(out ppunk));
            }

            ppunk = null;
            return(VSConstants.E_NOTIMPL);
        }
예제 #12
0
        int IVsFindTarget.NavigateTo(TextSpan[] pts)
        {
            // do we need to activate/show window here first?
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.NavigateTo(pts));
            }

            return(VSConstants.E_NOTIMPL);
        }
예제 #13
0
        int IVsFindTarget.Replace(string pszSearch, string pszReplace, uint grfOptions, int fResetStartPoint, IVsFindHelper pHelper, out int pfReplaced)
        {
            IVsFindTarget findTarget = GetView(sourceFrame) as IVsFindTarget;

            if (findTarget != null)
            {
                return(findTarget.Replace(pszSearch, pszReplace, grfOptions, fResetStartPoint, pHelper, out pfReplaced));
            }

            pfReplaced = 0;
            return(VSConstants.E_NOTIMPL);
        }
        protected override void OnCreate()
        {
            _window = _componentModel.GetService <IInteractiveWindowFactoryService>().CreateWindow(_evaluator);
            _window.SubmissionBufferAdded += SubmissionBufferAdded;
            _textViewHost = _window.GetTextViewHost();
            var textView = _textViewHost.TextView;

            textView.Options.SetOptionValue(EnableFindOptionName, true);
            AutomationProperties.SetName(textView.VisualElement, Caption);

            var viewAdapter = _editorAdapters.GetViewAdapter(textView);

            _findTarget    = viewAdapter as IVsFindTarget;
            _commandTarget = viewAdapter as IOleCommandTarget;
        }
예제 #15
0
        /// <summary>
        /// Cleans up an existing editor if we are about to put a new one in place, used to close down the old editor bits as well as
        /// nulling out any cached objects that we have that came from the now dead editor.
        /// </summary>
        private void ClearOldEditor()
        {
            if (this.codeWindow != null)
            {
                this.codeWindow.Close();
                this.codeWindow = null;
            }

            if (this.textView != null)
            {
                this.textView.CloseView();
                this.textView = null;
            }

            this.cachedEditorCommandTarget = null;
            this.cachedEditorFindTarget    = null;
            this.invisibleEditor           = null;
        }
예제 #16
0
        protected override void OnCreate()
        {
            _replWindow.Initialize();

            _adapterFactory = _replWindow.ComponentModel.GetService <IVsEditorAdaptersFactoryService>();

            var textView = _replWindow.CurrentView;

            SetDefaultFontSize(_replWindow.ComponentModel, textView);

            // create adapters so VS is happy...
            var serviceProvider = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)GetService(typeof(Microsoft.VisualStudio.OLE.Interop.IServiceProvider));

            _view       = _adapterFactory.GetViewAdapter(textView);
            _findTarget = _view as IVsFindTarget;

            CurrentView.Closed += OnClose;

            _content = _replWindow.Content;
        }
예제 #17
0
        protected override void OnCreate()
        {
            _replWindow.Initialize();

            _adapterFactory = _replWindow.ComponentModel.GetService<IVsEditorAdaptersFactoryService>();

            var textView = _replWindow.CurrentView;

            SetDefaultFontSize(_replWindow.ComponentModel, textView);

            // create adapters so VS is happy...
            var serviceProvider = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)GetService(typeof(Microsoft.VisualStudio.OLE.Interop.IServiceProvider));

            _view = _adapterFactory.GetViewAdapter(textView);
            _findTarget = _view as IVsFindTarget;

            CurrentView.Closed += OnClose;

            _content = _replWindow.Content;
        }
예제 #18
0
 internal void SetFindTarget(IVsFindTarget ft)
 {
     _findTarget  = ft;
     _findTarget2 = ft as IVsFindTarget2;
 }
예제 #19
0
 protected override void OnCreate()
 {
     _window = _componentModel.GetService<IInteractiveWindowFactoryService>().CreateWindow(_evaluator);
     _window.SubmissionBufferAdded += SubmissionBufferAdded;
     _textViewHost = _window.GetTextViewHost();
     var viewAdapter = _editorAdapters.GetViewAdapter(_textViewHost.TextView);
     _findTarget = viewAdapter as IVsFindTarget;
     _commandTarget = viewAdapter as IOleCommandTarget;
 }
예제 #20
0
 internal void SetFindTarget(IVsFindTarget ft)
 {
     _findTarget = ft;
     _findTarget2 = ft as IVsFindTarget2;
 }
        /// <summary>
        /// Cleans up an existing editor if we are about to put a new one in place, used to close down the old editor bits as well as
        /// nulling out any cached objects that we have that came from the now dead editor.
        /// </summary>
        internal void ClearEditor()
        {
            if (this.codeWindow != null)
            {
                this.codeWindow.Close();
                this.codeWindow = null;
            }

            if (this.textView != null)
            {
                this.textView.CloseView();
                this.textView = null;
            }

            this.cachedEditorCommandTarget = null;
            this.cachedEditorFindTarget = null;
            this.invisibleEditor = null;
        }