示例#1
0
        private void SiguienteEpisodio()
        {
            MakeVisible();
            if (flagepisodio) //si llegó al final del capitulo actualizar datos y mostrar botones
            {
                paginas += paginasaux;
                episodios++;

                if (mangaG.GetActual() < mangaG.GetEpisodes().Count() && mangaG.GetActual() >= mangaG.GetUltimoEpisodioLeido() && mangaG.GetUltimoEpisodioLeido() < mangaG.GetEpisodes().Count())
                {
                    mangaG.GetEpisodes().ElementAt <Episode>(mangaG.GetActual()).SetRead(true);
                    mangaG.SetUltimoEpisodioLeido(mangaG.GetActual() + 1);
                    mangaG.SetActual(mangaG.GetActual() + 1);
                    var t = Task.Run(() => Clases.XmlIO.WriteJsonData(MangasG));
                }
                else if (mangaG.GetActual() < mangaG.GetEpisodes().Count())
                {
                    mangaG.SetActual(mangaG.GetActual() + 1);
                }
                flagepisodio = false;
            }
        }
示例#2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            MangasG = new List <Manga>();
            MakeInvisible();
            List <Manga> Mangas = e.Parameter as List <Manga>;
            Manga        manga  = Mangas.ElementAt <Manga>(Mangas.ElementAt <Manga>(0).GetMangaActual());

            if (localSettings.Values["readingDirection"].ToString() == "1")
            {
                flipView.FlowDirection = FlowDirection.RightToLeft;
            }
            else
            {
                flipView.FlowDirection = FlowDirection.LeftToRight;
            }
            if (localSettings.Values["readingDirection"].ToString() == "2")
            {
                flipView.ItemsPanel = Resources["vertical"] as ItemsPanelTemplate;
            }
            loading.IsActive = true;
            mangaG           = manga;
            MangasG          = Mangas;


            try
            {
                episodeG = await Clases.Functions.LoadEpisodeAsync(mangaG.GetEpisodes().ElementAt(mangaG.GetActual()).GetDirectory());

                await Clases.Functions.CheckPagesNumber(episodeG);
                await CargarBitmap(-1, false);

                LoadFlipView();
                if (localSettings.Values[mangaG.GetName()] != null && !localSettings.Values[mangaG.GetName()].ToString().Equals("0") && mangaG.GetActual() == mangaG.GetUltimoEpisodioLeido())
                {
                    MoverPagina();
                }

                switch (localSettings.Values["AjusteImagen"].ToString())
                {
                case "1":
                    flipView.ItemTemplate = Resources["AjustarAncho"] as DataTemplate;
                    break;

                case "2":
                    flipView.ItemTemplate = Resources["AjustarAlto"] as DataTemplate;
                    break;

                default:
                    //opcion es 0
                    flipView.ItemTemplate = Resources["NoAjustar"] as DataTemplate;
                    break;
                }
                ActualizarInfo();
                CargarCBox();
                loading.IsActive = false;
                sw.Start();
            }
            catch (Exception)
            {
                loading.IsActive = false;
                var         imageUriForlogo = new Uri("ms-appx:///Assets/Imagen.png");
                BitmapImage image           = new BitmapImage
                {
                    UriSource = imageUriForlogo
                };
                flipView.Items.Add(image);
                EpisodeConter.Visibility = Visibility.Visible;
            }
        }