private async void SearchClickEvent(Episode episode)
 {
     if (!(await SeasonView.EpisodeViewMouseLeftUp(series, episode)))
     {
         EpisodeView.RightClickEvent(this, episode);
     }
 }
Esempio n. 2
0
        private async void Play_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            bool playing = await SeasonView.EpisodeViewMouseLeftUp(torrent.Series, torrent.Episode);

            if (!playing)
            {
                await MessageBox.Show("Files were probably deleted", "Error");
            }
        }
        public void LoadSeasons()
        {
            List <Episode> eps = Database.GetEpisodes(series.id);

            GenerateSearch(eps);
            List <List <Episode> > sorted = new List <List <Episode> >();

            for (int i = 1; ; i++)
            {
                List <Episode> list = eps.Where(a => a.airedSeason == i && !String.IsNullOrEmpty(a.firstAired) && Helper.ParseAirDate(a.firstAired).AddDays(1) < DateTime.Now).ToList();
                if (Properties.Settings.Default.EpisodeSort)
                {
                    list.Reverse();
                }
                if (list.Count != 0)
                {
                    sorted.Add(list);
                }
                else
                {
                    break;
                }
            }
            if (Properties.Settings.Default.EpisodeSort)
            {
                sorted.Reverse();
            }
            Dispatcher.Invoke(() => {
                SecondPanel.Children.RemoveRange(0, SecondPanel.Children.Count);
                foreach (var list in sorted)
                {
                    SeasonView sv = new SeasonView(list, series, this);
                    sv.ScrollView.PreviewMouseWheel += (s, ev) => Scroll(ev);
                    sv.Height = 195;
                    sv.Margin = new Thickness(0, 0, 35, 20);
                    SecondPanel.Children.Add(GenerateText("Season " + list[0].airedSeason));
                    SecondPanel.Children.Add(sv);
                }
            }, DispatcherPriority.Send);
        }