示例#1
0
 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.");
     }
 }
示例#2
0
 public int GetIndex(Page index)
 {
     int ind = -1;
     for (int i = 0; i < mList.Count; i++)
         if (mList[i] == index)
             ind = i;
     return ind;
 }
示例#3
0
 public bool CheckSite(Page aSite)
 {
     bool result = true;
     if (mList.Count > 0)
         if (!aSite.Adress.Host.Contains(Site.Adress.Host))
             result = false;
     return result;
 }
示例#4
0
 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;
 }
示例#5
0
 public int Add(string site)
 {
     Page u = new Page(site);
     return Add(u);
 }
示例#6
0
 public PageScanner(Page site)
 {
     
 }