コード例 #1
0
ファイル: PdfPanel.cs プロジェクト: wiera987/PDFComp
        public bool Search(string text, bool matchCase = false, bool matchWholeWord = false, bool highlight = false)
        {
            Cursor.Current = Cursors.WaitCursor;

            if (_searchManager == null)
            {
                _searchManager = new PdfSearchManager(pdfViewer.Renderer);
            }
            _searchManager.MatchCase           = matchCase;
            _searchManager.MatchWholeWord      = matchWholeWord;
            _searchManager.HighlightAllMatches = highlight;
            bool result = _searchManager.Search(text);

            Cursor.Current = Cursors.Default;

            return(result);
        }
コード例 #2
0
        private void Find(bool forward)
        {
            if (_findDirty)
            {
                _findDirty = false;

                if (!_searchManager.Search(_find.Text))
                {
                    MessageBox.Show(this, "No matches found.");
                    return;
                }
            }

            if (!_searchManager.FindNext(forward))
            {
                MessageBox.Show(this, "Find reached the starting point of the search.");
            }
        }