예제 #1
0
        private void OnAction_IncrementalSearch_Execute(object sender, EventArgs e)
        {
            statIncSearch.Text = String.Empty;
            if (_revIncSearch != null)
            {
                DisposeIncrementalSearchEvents(_revIncSearch);
                _revIncSearch.Dispose();
                _revIncSearch = null;
            }

            if (_fwdIncSearch != null)
            {
                DisposeIncrementalSearchEvents(_fwdIncSearch);
                _fwdIncSearch.Dispose();
                _fwdIncSearch = null;
                return;
            }

            _fwdIncSearch = new IncrementalSearch(_textEditor, true);
            _fwdIncSearch.OnIncrementalSearchMessage += new IncrmentalSearchMessageDelegate(OnIncrementalSearchMessage);
            _fwdIncSearch.OnIncrementalSearchStopped += new EventHandler(OnIncrementalSearchStopped);
        }
예제 #2
0
        public override void Run()
        {
            IWorkbenchWindow window = WorkbenchSingleton.Workbench.ActiveWorkbenchWindow;

            if (window != null)
            {
                ITextEditorControlProvider textEditorControlProvider = window.ActiveViewContent as ITextEditorControlProvider;
                if (textEditorControlProvider != null)
                {
                    if (incrementalSearch != null)
                    {
                        incrementalSearch.Dispose();
                    }
                    incrementalSearch = new IncrementalSearch(textEditorControlProvider.TextEditorControl, Forwards);
                }
            }
        }