Beispiel #1
0
        public async Task ReloadPostList()
        {
            var store  = new StoreToFiles();
            var client = new My2chClient();

            try
            {
                var tmpThread = await store.AddOrUpdateThreadInformation(Thread);

                var posts = await client.GetFullPostList(tmpThread);

                posts = await store.AddPosts(posts, tmpThread);

                tmpThread.Posts = posts;
                Thread          = tmpThread;
                await Task.Delay(300);

                ScrollToCurrentOffset();
            }
            catch (Exception ex)
            {
                var dialog = new MessageDialog(ex.Message, "スレッドの取得中にエラーが発生しました。");
                await dialog.ShowAsync();
            }
        }
Beispiel #2
0
        public async Task Refresh()
        {
            var client = new My2chClient();

            try
            {
                var newPosts = await client.GetFullPostList(thread);

                var store = new StoreToFiles();
                var posts = await store.AddPosts(newPosts, thread);
            }
            catch (Exception ex)
            {
                var dialog = new MessageDialog(ex.Message, "スレッドの取得中にエラーが発生しました。");
                await dialog.ShowAsync();
            }
        }
        public async Task Refresh()
        {
            var store  = new StoreToFiles();
            var client = new My2chClient();

            foreach (var thread in threadList)
            {
                try
                {
                    var posts = await client.GetFullPostList(thread);

                    await store.AddPostsWithMidokuCount(posts, thread);
                }
                catch (Exception ex)
                {
                    var dialog = new MessageDialog(thread.Name + ": " + ex.Message, "スレッドの更新に失敗しました。");
                    await dialog.ShowAsync();
                }
            }

            store.LoadThreads(threadList);
        }