示例#1
0
        public FreeviewHandler(Manga manga, MangaPage currentPage)
        {
            this.CurrentPage = currentPage;
            this.Manga = manga;

            Refresh(null);
        }
示例#2
0
        private async Task <bool> AgregarMangaFolder(StorageFolder folder)
        {
            Manga Manga1 = new Manga();
            await Task.Yield();

            Manga1 = await(Clases.Functions.LoadAllAsync(folder, folder.Path, folder.Name, "0", "0"));
            if (Manga1 != null)
            {
                Mangas.Add(Manga1);
                GuardarImagen(folder.Name);
                //Mangas = Mangas.OrderBy(o => o.GetName()).ToList();
                SaveData();
                await Task.Delay(1200);

                AjustarOrdenFunction();
                InsertInPosition(folder.Name);

                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#3
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;
            }
        }
示例#4
0
        private void LoadManga(string BaseFile, MangaConfiguration configuration = null)
        {
            book = new Manga(BaseFile);
            SetCurrentPage(book.GetPage(BaseFile));

            if (configuration != null)
                book.Configuration.CopyFrom(configuration);

            applyOptions();
        }