Exemple #1
0
        void onStart()
        {
            try
            {
                string file = File.ReadAllText("list.json");

                list = JArray.Parse(file);
                for (int i = 0; i < list.Count(); i++)
                {
                    string     json  = list[i].ToString();
                    MangaEntry manga = Newtonsoft.Json.JsonConvert.DeserializeObject <MangaEntry>(json);
                    AddToList(manga);
                }
            }
            catch {
                System.Windows.MessageBox.Show("Json read failed");
            }
        }
Exemple #2
0
        void AddToList(MangaEntry manga)
        {
            string status = manga.ReadStatus;

            if (status == MangaStatus.Reading.Name)
            {
                ReadingBox.Items.Insert(0, manga);
            }
            else if (status == MangaStatus.Completed.Name)
            {
                Completedbox.Items.Insert(0, manga);
            }
            else if (status == MangaStatus.PlanToRead.Name)
            {
                PlanToRead.Items.Insert(0, manga);
            }
            else if (status == MangaStatus.Dropped.Name)
            {
                Dropped.Items.Insert(0, manga);
            }
        }