예제 #1
0
 private void lbxInitNavLinks_MenuItem_Click(object sender, RoutedEventArgs e)
 {
     if (lbxInitNavLinks.SelectedItems.Count >= 1)
     {
         linkCategory newValue = (linkCategory)Convert.ToInt32((sender as FrameworkElement).Tag);
         foreach (LinkObject item in lbxInitNavLinks.SelectedItems)
         {
             item.category = newValue;
         }
     }
 }
예제 #2
0
 private void Navigator(ref bool searching, int ContentTarget)
 {
     if (currentIndex < CatagorizedLinks[currentKey].Count)
     {
         string dir  = dataFolder + Enum.GetName(linkCategory.NotUsed.GetType(), CatagorizedLinks[currentKey][currentIndex].category) + "\\";
         string path = dir + CatagorizedLinks[currentKey][currentIndex].guid + ".html";
         if (System.IO.Directory.Exists(dir) == false)
         {
             System.IO.Directory.CreateDirectory(dir);
         }
         if (System.IO.File.Exists(path) == false || new System.IO.FileInfo(path).Length <= 3000) // verifying its not a near empty html file
         {
             if (ContentTarget == 1)
             {
                 b1path    = path;
                 b1Content = CatagorizedLinks[currentKey][currentIndex];
                 wbDownloader1.Navigate(b1Content.url);
             }
             else
             {
                 b2path    = path;
                 b2Content = CatagorizedLinks[currentKey][currentIndex];
                 wbDownloader2.Navigate(b2Content.url);
             }
             searching = false;
         }
         else
         {
             currentIndex++;
         }
     }
     else
     {
         if (AllKeys.IndexOf(currentKey) + 1 < AllKeys.Count)
         {
             currentKey   = AllKeys[AllKeys.IndexOf(currentKey) + 1];
             currentIndex = 0;
         }
         else
         {
             if (ContentTarget == 1)
             {
                 b1Content = null;
             }
             else
             {
                 b2Content = null;
             }
             searching = false;
         }
     }
 }
예제 #3
0
 public void InitializeDownloadVariables()
 {
     CatagorizedLinks.Clear();
     foreach (LinkObject link in ioPathLinkObjects.UnPack <List <LinkObject> >())
     {
         if (link.category != linkCategory.NotUsed)
         {
             if (CatagorizedLinks.ContainsKey(link.category) == false)
             {
                 CatagorizedLinks.Add(link.category, new List <LinkObject>());
             }
             CatagorizedLinks[link.category].Add(link);
         }
     }
     AllKeys      = CatagorizedLinks.Keys.ToList();
     currentKey   = AllKeys[0];
     currentIndex = 0;
     // initialize a normalize interface starting state
     isIdle = true;
     wbDownloader1.Navigate("http://www.bing.com");
     wbDownloader2.Navigate("http://www.bing.com");
 }
예제 #4
0
        public LinkObject(string _title, string _guid, linkCategory _cat = linkCategory.NotUsed)
        {
            guid = _guid; title = _title; category = _cat;
            string searchStr = title.getLetters();

            if (_cat == linkCategory.NotUsed)
            {
                if (searchStr.Contains("ATTRIBUTEDCL"))
                {
                    category = linkCategory.DclAttribute;
                }
                else if (searchStr.Contains("TILEDCL"))
                {
                    category = linkCategory.DclTile;
                }
                else if (searchStr.Contains("METHODACTIVEX"))
                {
                    category = linkCategory.Method;
                }
                else if (searchStr.Contains("EVENTACTIVEX"))
                {
                    category = linkCategory.Event;
                }
                else if (searchStr.Contains("PROPERTYACTIVEX"))
                {
                    category = linkCategory.Property;
                }
                else if (searchStr.Contains("OBJECTACTIVEX") || searchStr.Contains("COLLECTIONACTIVEX") || searchStr.Contains("INTERFACEACTIVEX"))
                {
                    category = linkCategory.Object;
                }
                else if (searchStr.Contains("AUTOLISP") && title.Split('(').First().Trim().Contains(" ") == false)
                {
                    category = linkCategory.Function;
                }
            }
        }