Esempio n. 1
0
        private static async Task AddLatestComicsToDataSource(int latestComicNumberInDataSource, Comic latestComic)
        {
            for (int i = latestComicNumberInDataSource + 1; i < latestComic._num; i++)
            {
                try
                {
                    string comicUrl = string.Format(ComicUrlFormat, i);
                    Comic  comic    = await GetComicFromWeb(comicUrl).ConfigureAwait(false);

                    AllItems.Add(comic);
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Failed to add comic number {0} to data source: {1}", i, ex);
                }
            }

            AllItems.Add(latestComic);
        }