private void fetchFiles(int index) { Cursor = System.Windows.Input.Cursors.Wait; try { var listfiles = MyScrapper.Webscraper(SearchList[index]); if (listfiles == null) { Xceed.Wpf.Toolkit.MessageBox.Show($"Did not get any file for the selected link."); Cursor = System.Windows.Input.Cursors.Arrow; return; } else { chkList.Items.Clear(); foreach (var item in listfiles) { var chk = new CheckBox() { Content = item, IsChecked = true, }; chk.Unchecked += Chk_Unchecked; chk.Checked += Chk_Checked; chkList.Items.Add(chk); } } lblFilesToDownload.Content = ($"{listfiles.Count} files to download."); } catch (Exception ex) { Xceed.Wpf.Toolkit.MessageBox.Show("An Error Occured, check your internet connection. \n " + ex.Message); Cursor = System.Windows.Input.Cursors.Arrow; } Cursor = System.Windows.Input.Cursors.Arrow; }
private void BtnFetch_Click(object sender, RoutedEventArgs e) { Cursor = System.Windows.Input.Cursors.Wait; MainURL = tbURL.Text.Trim(); var listfiles = MyScrapper.Webscraper(tbURL.Text.Trim()); if (listfiles == null) { Xceed.Wpf.Toolkit.MessageBox.Show($"Did not get any file."); Cursor = System.Windows.Input.Cursors.Arrow; return; } else { chkList.Items.Clear(); foreach (var item in listfiles) { var chk = new CheckBox() { Content = item, IsChecked = true, }; chk.Unchecked += Chk_Unchecked; chk.Checked += Chk_Checked; chkList.Items.Add(chk); } } lblFilesToDownload.Content = ($"{listfiles.Count} files to download."); Cursor = System.Windows.Input.Cursors.Arrow; }
private void MyThreadStartMethod() { SearchList = MyScrapper.GetGoogleLinks(searchLink, out fetchDone); }