Пример #1
0
        private void updateMangaFollowedListFic(List <Manga> mangaFollowedList)
        {
            if (!File.Exists(Program._followedManga))
            {
                throw new Exception();
            }
            string[] lines = new string[mangaFollowedList.Count];
            int      i     = 0;

            foreach (Manga m in mangaFollowedList)
            {
                String site = Outils.reencodeSite(m.MangaUrl);
                lines[i] = site + m.MangaTitleFromUrl + Program._separator + m.MangaPath + Program._separator + m.HigherChap;
                i++;
            }
            try
            {
                File.WriteAllLines(Program._followedManga, lines);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.GetType().ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error); }
        }
Пример #2
0
        public static List <Manga> updFavPath()
        {
            String[]     lines        = Outils.readTxtFile(Program._followedManga);
            List <Manga> mFollowedLst = new List <Manga>();

            for (int i = 0; i < lines.Length; i++)
            {
                String   site   = lines[i].Substring(0, 1);
                String[] s      = lines[i].Substring(1).Split(new[] { Program._separator }, StringSplitOptions.RemoveEmptyEntries);
                Manga    m      = new Manga(new Uri(s[0]));
                String   number = s[2];
                int.TryParse(number, out int nbrHigherChap);
                s[1]         = m.MangaPath;
                m.HigherChap = nbrHigherChap;
                mFollowedLst.Add(m);
                Outils.reencodeSite(m.MangaUrl);
                lines[i] = m.MangaUrl.ToString() + Program._separator + m.MangaPath + Program._separator + number;
            }
            File.WriteAllLines(Program._followedManga, lines);
            return(mFollowedLst);
        }