private void SetSearchParametersComplete(WebDownload oWebDownload) { try { DappleSearchWebDownload oDSWebDownload = oWebDownload as DappleSearchWebDownload; oWebDownload.Verify(); // --- If the search indices don't match, it's because a new search was done before this one completed, so discard these results --- if (oDSWebDownload.SearchIndex == m_lSearchIndex) { XmlDocument oDoc = new XmlDocument(); oDoc.Load(oWebDownload.ContentStream); SearchResultSet oPage1 = new SearchResultSet(oDoc); InitSearch(oPage1); } } catch (WebException) { this.Invoke(new MethodInvoker(SetSearchFailed)); } catch (XmlException) { this.Invoke(new MethodInvoker(SetSearchFailed)); } }
private void ForwardPageComplete(WebDownload oWebDownload) { DappleSearchWebDownload oDSWebDownload = oWebDownload as DappleSearchWebDownload; // --- If the search indices don't match, it's because a new search was done before this one completed, so discard these results --- if (oDSWebDownload.SearchIndex == m_lSearchIndex) { XmlDocument oDoc = new XmlDocument(); oDoc.Load(oWebDownload.ContentStream); SearchResultSet oPage = new SearchResultSet(oDoc); ExtendSearch(oPage, m_iCurrentPage); } }
private void ForwardPage(object sender, EventArgs e) { m_iCurrentPage++; if (m_iCurrentPage >= m_iAccessedPages) { m_iAccessedPages++; DappleSearchWebDownload oDownload = new DappleSearchWebDownload(m_oSearchBoundingBox, m_szSearchString, m_iCurrentPage, m_lSearchIndex, m_iPageSize); SetSearching(); oDownload.BackgroundDownloadMemory(new DownloadCompleteHandler(ForwardPageComplete)); } else { RefreshResultList(); } }
internal void SetSearchParameters(String szKeyword, GeographicBoundingBox oBoundingBox) { if (!MainForm.Settings.UseDappleSearch) { return; } m_lSearchIndex++; m_oSearchBoundingBox = oBoundingBox; m_szSearchString = szKeyword; if (String.Empty.Equals(szKeyword) && oBoundingBox == null) { SetNoSearch(); } else { UpdatePageSize(); DappleSearchWebDownload oDownload = new DappleSearchWebDownload(m_oSearchBoundingBox, m_szSearchString, 0, m_lSearchIndex, m_iPageSize); SetSearching(); oDownload.BackgroundDownloadMemory(new DownloadCompleteHandler(SetSearchParametersComplete)); } }
internal void SetSearchParameters(String szKeyword, GeographicBoundingBox oBoundingBox) { if (!MainForm.Settings.UseDappleSearch) return; m_lSearchIndex++; m_oSearchBoundingBox = oBoundingBox; m_szSearchString = szKeyword; if (String.Empty.Equals(szKeyword) && oBoundingBox == null) { SetNoSearch(); } else { UpdatePageSize(); DappleSearchWebDownload oDownload = new DappleSearchWebDownload(m_oSearchBoundingBox, m_szSearchString, 0, m_lSearchIndex, m_iPageSize); SetSearching(); oDownload.BackgroundDownloadMemory(new DownloadCompleteHandler(SetSearchParametersComplete)); } }