public LinkStatus ExtractLinks() { if (String.Empty == m_strUrl) { throw new ArgumentException("No URL specified"); } m_Links = new ImageDataCollection(); CreateParser(); if (m_obParser.Lexer.Page.mSource == null) { return(LinkStatus.Broken); } NodeFilter obFilter = new NodeClassFilter(typeof(ImageTag)); NodeList collNodes = m_obParser.Parse(obFilter); if (null != collNodes) { PageData obPageData = new PageData(); obPageData.m_strUrl = m_obParser.URL; obPageData.m_iDepth = m_iLevel; for (Int32 i = 0; i < collNodes.Count; i++) { INode obNode = collNodes[i]; ImageData obLinkData = new ImageData(obPageData, obNode as ImageTag); m_Links.Add(obLinkData); } } return(LinkStatus.Ok); }
public async Task LoadImages(List <string> list) { foreach (var file in list) { var item = new ImageData { FileName = file }; ImageDataCollection.Add(item); await item.Load(); } }
async public void ShowRightPicture(object obj) { var index = ImageDataCollection.IndexOf(ImageDataSelectedItem); if (index == ImageDataCollection.Count - 1) { return; } index++; ImageDataSelectedItem = ImageDataCollection[index]; ImageSource = await Task.Run(() => ImageLoader.Loadfile(ImageDataSelectedItem.FileName)); SetCountString(); }
public void SetCountString() { var i = ImageDataCollection.IndexOf(ImageDataSelectedItem); Name = String.Format("picture {0} selected of {1} pictures", ++i, ImageDataCollection.Count); }
public void ClearListView(object obj) { ImageDataCollection.Clear(); ListVisible = true; }