Ejemplo n.º 1
0
        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));
            }
        }
Ejemplo n.º 2
0
        private void InitSearch(SearchResultSet oResults)
        {
            if (InvokeRequired)
            {
                this.Invoke(new InitResultsDelegate(InitSearch), new Object[] { oResults });
                return;
            }
            else
            {
                m_iCurrentPage   = 0;
                m_iAccessedPages = 1;

                if (oResults != null)
                {
                    int iNumPages = c_oPageNavigator.PagesFromResults(oResults.TotalCount);

                    m_aPages = new SearchResultSet[iNumPages];

                    if (iNumPages > 0)
                    {
                        m_aPages[0] = oResults;
                    }
                }
                else
                {
                    m_aPages = null;
                }
                RefreshResultList();
            }
        }
Ejemplo n.º 3
0
        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);
            }
        }
Ejemplo n.º 4
0
 private void ExtendSearch(SearchResultSet oResults, int iPage)
 {
     if (InvokeRequired)
     {
         this.Invoke(new UpdateResultsDelegate(ExtendSearch), new Object[] { oResults, iPage });
         return;
     }
     else
     {
         if (oResults != null)
         {
             m_aPages[iPage] = oResults;
         }
         else
         {
             c_oPageNavigator.SetState("DappleSearch not configured");
         }
         RefreshResultList();
     }
 }
Ejemplo n.º 5
0
        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));
            }
        }
Ejemplo n.º 6
0
        private void InitSearch(SearchResultSet oResults)
        {
            if (InvokeRequired)
            {
                this.Invoke(new InitResultsDelegate(InitSearch), new Object[] { oResults });
                return;
            }
            else
            {
                m_iCurrentPage = 0;
                m_iAccessedPages = 1;

                if (oResults != null)
                {
                    int iNumPages = c_oPageNavigator.PagesFromResults(oResults.TotalCount);

                    m_aPages = new SearchResultSet[iNumPages];

                    if (iNumPages > 0)
                    {
                        m_aPages[0] = oResults;
                    }
                }
                else
                {
                    m_aPages = null;
                }
                RefreshResultList();
            }
        }
Ejemplo n.º 7
0
        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);
            }
        }
Ejemplo n.º 8
0
 private void ExtendSearch(SearchResultSet oResults, int iPage)
 {
     if (InvokeRequired)
     {
         this.Invoke(new UpdateResultsDelegate(ExtendSearch), new Object[] { oResults, iPage });
         return;
     }
     else
     {
         if (oResults != null)
         {
             m_aPages[iPage] = oResults;
         }
         else
         {
             c_oPageNavigator.SetState("DappleSearch not configured");
         }
         RefreshResultList();
     }
 }