예제 #1
0
        private async void FavoriteBtn_Click(object sender, RoutedEventArgs e)
        {
            MainPanel.Children.Clear();
            label.Visibility = Visibility.Visible;
            label.FontSize   = 100;
            Config cfg = new Config();

            cfg.Load();
            List <string> favs = cfg.ArrayValue <string>(Settings.favorites).ToList();

            favs = favs.Where(x => Directory.Exists(x) || x.isUrl()).Distinct().ToList();
            InternetP parser = new InternetP();

            parser.start  = (int count) => label.Content = "0/" + count;
            parser.update = (Hitomi h, int index, int max) =>
            {
                label.Content = $"{index}/{max}";
                MainPanel.Children.Add(new HitomiPanel(h, this));
            };
            parser.end = () => label.Visibility = Visibility.Collapsed;
            await parser.LoadCompre(favs);

            label.Visibility = Visibility.Collapsed;
        }