private async void SearchToday() { if (groupBoxFano.IsVisible || groupBoxKinozal.IsVisible || groupBoxFilebase.IsVisible) { UIDisable(); borderBack.Visibility = Visibility.Collapsed; btnBack.Visibility = Visibility.Collapsed; Title = txtToday.Text + " torrenti"; progressBar.Visibility = Visibility.Visible; containerCovers.Children.Clear(); containerList.Children.Clear(); filterPanel.Content = null; filterPanelCategorys.Content = null; TorrentList tList = new TorrentList(); containerList.Children.Add(tList); await tList.Search("", "Visas", "Visi", "Visi", true); while (!tList.fanoCompleted || !tList.kinozalCompleted || !tList.filebaseCompleted) { await Task.Delay(300); } UIEnable(); CategoryFilter catFilter = new CategoryFilter(tList, tList.categorySet); filterPanelCategorys.Content = catFilter; filterPanelCategorys.Visibility = Visibility.Visible; } else { MessageBox.Show("Jāpievieno vismaz viens trakeris, lai meklētu!", "TM", MessageBoxButton.OK, MessageBoxImage.Information); } }
private async void MekletStart() { if (groupBoxFano.IsVisible || groupBoxKinozal.IsVisible || groupBoxFilebase.IsVisible) { UIDisable(); borderBack.Visibility = Visibility.Collapsed; btnBack.Visibility = Visibility.Collapsed; progressBar.Visibility = Visibility.Visible; containerCovers.Children.Clear(); containerList.Children.Clear(); filterPanel.Content = null; filterPanelCategorys.Content = null; TorrentList tList = new TorrentList(); containerList.Children.Add(tList); await tList.Search(CmbMeklet.Text, cmbCategory.Text, cmbGenre.Text, cmbYear.Text, false); while (!tList.fanoCompleted || !tList.kinozalCompleted || !tList.filebaseCompleted) { await Task.Delay(300); } CategoryFilter catFilter = new CategoryFilter(tList, tList.categorySet); filterPanelCategorys.Content = catFilter; filterPanelCategorys.Visibility = Visibility.Visible; if (!string.IsNullOrEmpty(CmbMeklet.Text.Trim())) { Title = CmbMeklet.Text.Trim(); config.DeleteHistoryElementIfExist(CmbMeklet.Text.Trim()); config.AddHistory(CmbMeklet.Text.Trim()); CmbMeklet.Items.Clear(); LoadHistory(); CmbMeklet.Text = ""; } UIEnable(); cmbCategory.IsEnabled = true; EnableComboBoxes(cmbCategory.Text); } else { MessageBox.Show("Jāpievieno vismaz viens trakeris, lai meklētu!", "TM", MessageBoxButton.OK, MessageBoxImage.Information); } }