private void ReadImages() { var images = Document.DocumentNode.SelectNodes("//div[contains(concat(' ',@class,' '),' content ')]//img[@src]"); if (images == null) { return; } foreach (var img in images) { var src = img.GetAttributeValue("src", null); if (src == null) { continue; } src = WebUtility.HtmlDecode(src); var dt = ReadImageDate(img); if (src.Contains("http://forums.nrvnqsr.com/attachment.php")) { Images.Add(new BLImage { Url = GetFullAttachmentUrl(src), PageNumber = CurrentPageNumber, PostDate = dt }); } else if (IsValidNonRelativeUrl(src) && Images.All(b => b.Url != src)) { Images.Add(new BLImage { Url = GetProperUrl(src), PageNumber = CurrentPageNumber, PostDate = dt }); } } }
private void PrevImage() { if (Images.Count == 0 || Images.All(i => i == null)) { return; } Image = Images.GetPrevious(); while (Image == null) { Image = Images.GetPrevious(); } }
private void NextImage() { if (Images.Count == 0 || Images.All(i => i == null)) { return; } Image = Images.GetNext(); while (Image == null) { Image = Images.GetNext(); } }
public IEnumerable <Image> Get() { return(Images.All()); }