コード例 #1
0
        private void OnSearchNext(object sender, EventArgs e)
        {
            object state = _form.BeginSearchingNext();

            _form.CanSearchNext = false;
            try
            {
                Layout layout = _form.GetLayout();
                foreach (WebSearchResult result in layout.Results)
                {
                    result.IsHighlighted = false;
                }
                int startIndex = 1 + _parsedPages;
                int endIndex   = startIndex + layout.PagesPerSet - 1;
                for (int i = startIndex; i <= endIndex; i++)
                {
                    _parsedPages++;
                    if (_parsedPages > _totalPages)
                    {
                        return;
                    }
                    List <WebSearchResult> newResults = SearchOnPage(i, layout);
                    for (int j = 0; j < newResults.Count; j++)
                    {
                        _form.ResultCount++;
                        newResults[j].IsHighlighted = true;
                        _form.AddResultEntry(newResults[j]);
                    }
                }
            }
            finally
            {
                _form.EndSearchingNext(state);
                _form.CanSearchNext = true;
                _form.CanSearchNext = _parsedPages < _totalPages;
            }
            SortBy();
        }