public bool this[Page index] { get { Page tmp = null; for (int i = 0; i < mList.Count; i++) if (mList[i] == index) tmp= mList[i]; if (tmp!=null) return tmp.Scanned; else throw new Exception("Item not found."); } set { Page tmp = null; for (int i = 0; i < mList.Count; i++) if (mList[i] == index) tmp = mList[i]; if (tmp != null) tmp.Scanned = value; else throw new Exception("Item not found."); } }
public int GetIndex(Page index) { int ind = -1; for (int i = 0; i < mList.Count; i++) if (mList[i] == index) ind = i; return ind; }
public bool CheckSite(Page aSite) { bool result = true; if (mList.Count > 0) if (!aSite.Adress.Host.Contains(Site.Adress.Host)) result = false; return result; }
public int Add(Page site) { int result = -1; /*if ((site.Adress.IsAbsoluteUri)&&(site.Adress.Host.StartsWith("www."))) { string addr = site.Adress.OriginalString; addr = addr.Replace("http://www.", "http://"); site = new Page(addr); }*/ if ((mList.Count > 0) && (!site.Adress.OriginalString.StartsWith(Site.Adress.OriginalString))) site.Adress = new Uri(Site.Adress, site.Adress); if (Check(site.Adress.OriginalString) && CheckSite(site)) { var st = from s in mList where s.Adress == site.Adress select s; if (st.Count<Page>() < 1) { mList.Add(site); result = mList.Count - 1; } } return result; }
public int Add(string site) { Page u = new Page(site); return Add(u); }
public PageScanner(Page site) { }