Пример #1
0
 private static string GenerateMangaPageFileName(string mangaBookTitle, MangaPage mangaPage)
 {
     return String.Format("{0}{1:00}.{2}", mangaBookTitle, mangaPage.PageNumber, mangaPage.ImageFormat);
 }
        protected void AddNewPagesToMangaBook(MangaBook mangaBook, HtmlNodeCollection selectOptionNodes)
        {
            if (selectOptionNodes == null) return;

            // create new pages and add it to the mangabook.

            foreach (HtmlNode selectOption in selectOptionNodes)
            {
                int pageNumber;

                bool isNumeric = int.TryParse(selectOption.InnerText, out pageNumber);

                if (!isNumeric) continue;

                MangaPage mangaPage = new MangaPage
                {
                    PageNumber = pageNumber,
                    PageUrl = GetFullPageUrl(selectOption, mangaBook)
                };
                mangaBook.Pages.Add(mangaPage);
            }
        }