예제 #1
0
 private void lsvBlimps_DoubleClick(object sender, EventArgs e)
 {
     if (lsvBlimps.SelectedItems.Count == 1)
     {
         Blimp pig = fatties.Find(body =>
                                  body.sml == lsvBlimps.SelectedItems[0].SubItems[2].Text);
         if (File.Exists(pig.fapth + pig.sml))
         {
             try { OpenFolderAndSelectFile(pig.fapth + pig.sml); } catch {}
         }
     }
 }
예제 #2
0
 private void tsmOriginal_Click(object sender, EventArgs e)
 {
     if (lsvBlimps.SelectedItems.Count == 1)
     {
         Blimp pig = fatties.Find(body =>
                                  body.sml == lsvBlimps.SelectedItems[0].SubItems[2].Text);
         string first = (pig.isTaut) ? pig.big : pig.sml;
         first = Regex.Replace(first, @"\(\d+\)", "");
         if (File.Exists(pig.fapth + first))
         {
             try { OpenFolderAndSelectFile(pig.fapth + first); } catch {}
         }
     }
 }
예제 #3
0
        List <Blimp> Bloated(List <FileInfo> gut)
        {
            List <Blimp> blimps = new List <Blimp>();

            foreach (FileInfo swell in gut)
            {
                Blimp blimp = new Blimp(swell);
                if (blimp.big != null)
                {
                    blimps.Add(blimp);
                }
                pbar.PerformStep();
            }
            return(blimps);
        }
예제 #4
0
 private void btnRecycle_Click(object sender, EventArgs e)
 {
     foreach (ListViewItem thin in lsvBlimps.SelectedItems)
     {
         Blimp skinny = fatties.Find(body =>
                                     body.sml == thin.SubItems[2].Text);
         try
         { FileSystem.DeleteFile(skinny.fapth + skinny.sml,
                                 UIOption.OnlyErrorDialogs, RecycleOption.SendToRecycleBin); }
         catch {}
         fatties.Remove(skinny);
         lsvBlimps.Items.Remove(thin);
     }
     lblMates.Text = nMates();
     if (fatties.Count == 0)
     {
         btnCommit.Enabled = false;
     }
 }
예제 #5
0
        void Fill()
        {
            Blimp.Swell(txtBefore.Text, txtAfter.Text,
                        chkSearch.Checked, chkFolderName.Checked,
                        chkDuplicates.Checked, chkExtChecker.Checked, chkForce.Checked);
            List <string[]> pigs = new List <string[]>();

            if (chkNameSwap.Checked && File.Exists(pimp))
            {
                using (StreamReader sr = new StreamReader(pimp))
                { string line;
                  bool   begin = false;
                  while ((line = sr.ReadLine()) != null)
                  {
                      if (!begin)
                      {
                          if (Regex.IsMatch(line, "-{3,}"))
                          {
                              begin = true;
                          }
                          continue;
                      }
                      string[] names = line.Split(',');
                      if (names.Length > 1)
                      {
                          pigs.Add(names);
                      }
                  }
                }
            }
            Blimp.bigs = pigs;

            pbar.Value        = 0;
            btnRescan.Enabled = btnRemove.Enabled = btnRecycle.Enabled = false;
            lsvBlimps.Items.Clear();

            if (chkSubFolders.Checked)
            {
                Bitch.Burst();
                Bitch moar = new Bitch(bitchz);
                pbar.Maximum = moar.fam.Count;
                fatties      = Bloated(moar.fam);
            }
            else
            {
                List <FileInfo> hoez = bitchz.GetFiles().ToList();
                pbar.Maximum = hoez.Count;
                fatties      = Bloated(hoez);
            }

            foreach (Blimp mate in fatties)
            {
                ListViewItem mass = new ListViewItem(mate.mod.ToString());
                mass.SubItems.AddRange(new string[]
                                       { mate.big, mate.sml, mate.isTaut.ToString(), mate.hasTwin.ToString() });

                if (mate.hasTwin)                 // has a (1) in the name
                {
                    mass.BackColor = Color.LightSkyBlue;
                }

                else if (mate.isTaut)                 // newSize already exists
                {
                    mass.BackColor = Color.LightSalmon;
                }

                else if (mate.isThick)                 // artist name changed
                {
                    mass.BackColor = Color.GreenYellow;
                }

                else if (mate.isTrap)                 // extension changed
                {
                    mass.BackColor = Color.Gold;
                }

                lsvBlimps.Items.Add(mass);
            }

            if (fatties.Count > 0)
            {
                colRename.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
                colRename.Width += 20;
            }

            foreach (ListViewItem mass in lsvBlimps.Items)
            {
                mass.SubItems[1].Text = mass.SubItems[2].Text
                                        + "\n" + mass.SubItems[1].Text;
            }

            lsvBlimps.Sorting = SortOrder.Ascending;
            datAss            = 00;
            ShakeDat();
            btnRescan.Enabled = true;
            btnCommit.Enabled = (fatties.Count > 0);
            lblMates.Text     = nMates();
            lsvBlimps.Focus();
        }