Beispiel #1
0
 public void LoadFullPage()
 {
     ResultPaneStack.Children.Clear();
     for (int i = 0; i < gsrm.ResultCount; i++)
     {
         SearchResultCard card = new SearchResultCard()
         {
             Title           = HtmlRemoval.StripTagsRegexCompiled(gsrm.SearchResults[i]),
             Link            = gsrm.SearchResultsLinks[i],
             MouseOverBrush  = new SolidColorBrush(Color.FromArgb(10, 0, 0, 0)),
             TitleForeground = new SolidColorBrush(Colors.Gray),
             LinkForeground  = new SolidColorBrush(Color.FromArgb(255, 74, 49, 211)),
             Width           = SidePaneWidth - 28,
             Margin          = new Thickness(2, 0, 2, 0)
         };
         Tag = i;
         card.MouseDoubleClick += card_MouseDoubleClick;
         ResultPaneStack.Children.Add(card);
     }
     LeftArrow.Text  = left;
     RightArrow.Text = right;
     SearchBox.Text  = HtmlRemoval.StripTagsRegexCompiled(gsrm.SearchResults[0]);
     UpdateStatus(gsrm.SearchResultsLinks[0]);
     Browser.Navigate(gsrm.SearchResultsLinks[0]);
     Progress.IsIndeterminate = true;
 }
Beispiel #2
0
 private void Right_MouseDown(object sender, MouseButtonEventArgs e)
 {
     CurrentLink = CurrentLink + 1;
     if (CurrentLink >= gsrm.SearchResultsLinks.Count)
     {
         if (CurrentLink == gsrm.SearchResultsLinks.Count)
         {
             Status.Content = "Last Link On Page, press " + right + " again to go to next page of results.";
         }
         else if (CurrentLink == gsrm.SearchResultsLinks.Count + 1)
         {
             Status.Content = " Loading next page : ";
             CurrentLink    = -1;
             gsrm.NextPage();
             LoadFullPage();
             if (gsrm.ResultCount > 0)
             {
                 CurrentPage++;
                 CurrentLink     = 0;
                 LeftArrow.Text  = left;
                 RightArrow.Text = right;
                 SearchBox.Text  = HtmlRemoval.StripTagsRegexCompiled(gsrm.SearchResults[0]);
                 UpdateStatus(gsrm.SearchResultsLinks[0]);
                 Browser.Navigate(gsrm.SearchResultsLinks[0]);
                 Progress.IsIndeterminate = true;
             }
             else
             {
                 CurrentPage++;
                 CurrentLink     = 0;
                 LeftArrow.Text  = "";
                 RightArrow.Text = "";
                 Status.Content  = "No results found. Please try again, with a new search key.";
                 SearchBox.Text  = "";
                 SearchBox.Focus();
             }
         }
     }
     else
     {
         SearchBox.Text = HtmlRemoval.StripTagsRegexCompiled(gsrm.SearchResults[CurrentLink]);
         UpdateStatus(gsrm.SearchResultsLinks[CurrentLink]);
         Browser.Navigate(gsrm.SearchResultsLinks[CurrentLink]);
         Progress.IsIndeterminate = true;
     }
 }
Beispiel #3
0
 private void Left_MouseDown(object sender, MouseButtonEventArgs e)
 {
     CurrentLink = CurrentLink - 1;
     if (CurrentLink < 0)
     {
         Status.Content = " Loading next page : ";
         CurrentLink    = -1;
         gsrm.PrevPage();
         if (gsrm.ResultCount > 0)
         {
             CurrentPage--;
             CurrentLink     = 0;
             LeftArrow.Text  = left;
             RightArrow.Text = right;
             SearchBox.Text  = HtmlRemoval.StripTagsRegexCompiled(gsrm.SearchResults[0]);
             UpdateStatus(gsrm.SearchResultsLinks[0]);
             Browser.Navigate(gsrm.SearchResultsLinks[0]);
             Progress.IsIndeterminate = true;
         }
         else
         {
             CurrentPage--;
             CurrentLink     = 0;
             LeftArrow.Text  = "";
             RightArrow.Text = "";
             Status.Content  = "No results found. Please try again, with a new search key.";
             SearchBox.Text  = "";
             SearchBox.Focus();
         }
     }
     else
     {
         SearchBox.Text = HtmlRemoval.StripTagsRegexCompiled(gsrm.SearchResults[CurrentLink]);
         Status.Content = "Page " + (CurrentPage + 1) + ", Result " + (CurrentLink + 1) + " of " + gsrm.ResultCount + ", URL : " + gsrm.SearchResultsLinks[CurrentLink];
         Browser.Navigate(gsrm.SearchResultsLinks[CurrentLink]);
         Progress.IsIndeterminate = true;
     }
 }