예제 #1
0
        public void FetchNews(bool repeatViewed)
        {
            downloadNews();
            unpackNews();

            _unreadNews = Directory.GetFiles(_unreadNewsDir, "*.txt", SearchOption.TopDirectoryOnly)
                          .Where(file => repeatViewed || !File.Exists(getReadNewsFile(file)))
                          .OrderByDescending(Path.GetFileNameWithoutExtension, _versionComparer)
                          .ToList();

            NewsFetched?.Invoke();
        }
예제 #2
0
        public async Task FetchNews(bool repeatViewed, CancellationToken token)
        {
            await downloadNews(token);

            unpackNews();

            _unreadNews = _unreadNewsDir.EnumerateFiles("*.txt")
                          .Where(file => repeatViewed || !getReadNewsFile(file).IsFile())
                          .OrderByDescending(_ => _.Basename(extension: false), _versionComparer)
                          .ToList();

            NewsFetched?.Invoke();
        }