コード例 #1
0
        //fill the table with urls
        public void loadURLList(RootObject obj, string searchVal)
        {
            //remove old items
            urlsListView.Items.Clear();
            urlsListView.Items.Refresh();


            //add infomration to the result table
            searchValue.Text  = searchVal;
            searchTime.Text   = obj.searchInformation.formattedSearchTime + " seconds";
            totalResults.Text = obj.searchInformation.formattedTotalResults;

            //add urls from the first Google page to the result table table
            ResultEntry re;
            int         i = 1;

            if (obj.items != null)
            {
                foreach (Item item in obj.items)
                {
                    re         = new ResultEntry();
                    re.Ranking = i;
                    re.HitURL  = item.link;
                    urlsListView.Items.Add(re);
                    i++;
                }
            }
        }
コード例 #2
0
 //start the browser and open the website of the selected url by double click on an url in the table
 private void urlsListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (urlsListView.SelectedIndex > -1)
     {
         _selectedUrl = new ResultEntry();
         _selectedUrl = (ResultEntry)urlsListView.SelectedItem;
         Process.Start(_selectedUrl.HitURL);
     }
 }