public Page(Resource r) : base(r.Url, r.Parent) { if (!r.Loaded) { throw new InvalidOperationException(); } this.Resources = new List<Resource>(); MemoryStream ms = new MemoryStream(r.Content); StreamReader rd = new StreamReader(ms); this.HtmlContent = rd.ReadToEnd(); Analyse(); }
public void NewResource(Resource res) { if (UriSet.Contains(res.Url)) return; UriSet.Add(res.Url); lock (this) { if (res.Parent != null && res.Parent.Url.IsBaseOf(res.Url)) { PrimaryQueue.Enqueue(res); } else { SecondaryQueue.Enqueue(res); } } res.LoadOK += res_LoadOK; }
public SpiderWorkProgress(Resource res) { Resource = res; Exception = null; CurrentRead = 0; ContentLength = 0; }