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);
        }
Exemple #2
0
 public async Task LoadImages(List <string> list)
 {
     foreach (var file in list)
     {
         var item = new ImageData {
             FileName = file
         };
         ImageDataCollection.Add(item);
         await item.Load();
     }
 }