private void LoadData()
{
nextResources.Clear();
if (download.RemoteFileInfo.MimeType.IndexOf("text/html", StringComparison.OrdinalIgnoreCase) < 0)
{
return;
}
try
{
DownloadManager.Instance.OnBeginAddBatchDownloads();
using (Stream htmlStream = File.OpenRead(download.LocalFile))
{
using (HtmlParser parser = new HtmlParser(htmlStream))
{
AddUrls(parser.GetHrefs(context.BaseLocation), UrlType.Href);
AddUrls(parser.GetImages(context.BaseLocation), UrlType.Img);
AddUrls(parser.GetFrames(context.BaseLocation), UrlType.Frame);
AddUrls(parser.GetIFrames(context.BaseLocation), UrlType.IFrame);
}
}
}
finally
{
DownloadManager.Instance.OnEndAddBatchDownloads();
}
}