Esempio n. 1
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            AnimeList filteredList = new AnimeList();

            filteredList.addAnimeToList(animeList.getAnimeList());
            MainWindow mWindow = Owner as MainWindow;

            if (checkBox1.IsChecked.Value)
            {
                filteredList.removeAnimeWhichIsNotInTheList(animeList.getGerSubAnime());
            }

            if (checkBox2.IsChecked.Value)
            {
                filteredList.removeAnimeWhichIsNotInTheList(animeList.getEngSubAnime());
            }

            if (checkBox3.IsChecked.Value)
            {
                filteredList.removeAnimeWhichIsNotInTheList(animeList.getJapDubAnime());
            }

            if (checkBox4.IsChecked.Value)
            {
                filteredList.removeAnimeWhichIsNotInTheList(animeList.getEngDubAnime());
            }

            if (checkBox5.IsChecked.Value)
            {
                filteredList.removeAnimeWhichIsNotInTheList(animeList.getGerDubAnime());
            }

            if (!checkBox1.IsChecked.Value && !checkBox2.IsChecked.Value && !checkBox3.IsChecked.Value && !checkBox4.IsChecked.Value && !checkBox5.IsChecked.Value)
            {
                mWindow.listBox1.ItemsSource = animeList.getSortedAllTitle();
            }
            else
            {
                mWindow.listBox1.ItemsSource = filteredList.getSortedAllTitle();
            }
            this.Hide();
        }