Esempio n. 1
0
		/// <summary>
		/// Populate asynchronously.
		/// </summary>
		public async Task PopulateAsync() {
			var brokenPages = new List<string>();
			var comicInfoPage = (ComicInfoPage)null;
			var number = 0;
			var metaPages = new List<ComicInfoPage>();
			if (_series.PreviewImage != null) {
				metaPages.Add(_publisher.Publish(_series.PreviewImage, true, 0));
			}

		    foreach (var Page in _chapter.Children) {
		        await Page.PopulateAsync();
		        number++;
		        using (Page) {
		            if ((comicInfoPage = _publisher.Publish(Page.Image, false, number)) != null) {
		                metaPages.Add(comicInfoPage);
		                if (string.Equals(comicInfoPage.Type, "Deleted")) {
		                    brokenPages.Add(string.Format("{0}: {1}", number.ToString("000"), Page.Location));
		                }
		            }
		        }
		    }
			if (brokenPages.Count != 0) {
				_publisher.Publish(brokenPages);
			}
			if (metaPages.Count != 0) {
				var comicInfo = new ComicInfo();
				comicInfo.Transcribe(_series, _chapter, metaPages);
				_publisher.Publish(comicInfo);
			}
		}
Esempio n. 2
0
		/// <summary>
		/// Initialize a new instance of the Repair class.
		/// </summary>
		/// <param name="publisher">The publisher.</param>
		/// <param name="series">The series.</param>
		/// <param name="chapter">The chapter.</param>
		/// <param name="comicInfo">The comic information.</param>
		/// <param name="brokenPages">Each broken page.</param>
		public Repair(IPublisher publisher, ISeries series, IChapter chapter, ComicInfo comicInfo, IEnumerable<string> brokenPages) {
			_brokenPages = brokenPages;
			_chapter = chapter;
			_comicInfo = comicInfo;
			_publisher = publisher;
			_series = series;
		}