Esempio n. 1
0
 private void checkRemoveShort_CheckedChanged(object sender, EventArgs e)
 {
     if (Data.p != null && checkRemoveShort.Checked)
     {
         foreach (page Page in Data.p.pages)
         {
             floor[] Floors;
             int count = 0;
             foreach (floor Floor in Page.floors)
             {
                 if (Floor.content.Length >= Options.vVal)
                 {
                     count++;
                 }
             }
             Floors = new floor[count];
             int i = 0;
             foreach(floor Floor in Page.floors)
             {
                 if (Floor.content.Length >= Options.vVal)
                 {
                     Floors[i] = new floor();
                     Floors[i].owner = Floor.owner;
                     Floors[i].content = Floor.content;
                     Floors[i].images = Floor.images;
                     ++i;
                 }
             }
             Page.floors = Floors;
         }
         ContentBox.Invoke(new DelegateMethod(FillContentBox));
         PostTreeView.Invoke(new DelegateMethod(FillTreeView));
     }
 }
Esempio n. 2
0
 public floor[] getPageFloors(int number)
 {
     string url = from + (Options.doSeeLZonly ? "?see_lz=1&pn=" : "?pn=") + number;
     if (number != 1) raw = http.get(url);
     string pattern = "<cc>.*?</cc>";
     string[] rawfloors = match.preg_match_multi(raw, pattern);
     pattern = "(?<=<img\\s*?username=\").*?(?=\")";
     string[] owners = match.preg_match_multi(raw, pattern);
     floor[] floors = new floor[rawfloors.Length];
     for(int i = 0; i < rawfloors.Length; i++)
     {
         floors[i] = new floor();
         floors[i].owner = owners[i];
         floors[i].content = match.html2plain(rawfloors[i]);
         if (Options.doRemoveShort)
         {
             if (floors[i].content.Length < Options.vVal)
             {
                 floors[i].content = "";
             }
         }
         floors[i].images = getFloorImages(rawfloors[i]);
     }
     eliThreading.floorUpdate(floors.Length, 0);
     return floors;
 }