示例#1
0
        /*
         * public void extractArchiveSolid(string outputDir, string file)
         * {
         *  Invoke(new UpdateUI(() => setStatus("Extracting...", true)));
         *  using (Stream stream = File.OpenRead(file))
         *  {
         *      var reader = ReaderFactory.Open(stream);
         *      while (reader.MoveToNextEntry())
         *      {
         *          if (!reader.Entry.IsDirectory)
         *          {
         *              reader.WriteEntryToDirectory(@outputDir);
         *          }
         *      }
         *      Invoke(new UpdateUI(() => setStatus("Idle.", false)));
         *  }
         * }
         */

        private void btnReleaseBrowse_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fbdRelease = new FolderBrowserDialog();

            tsProgress.Value = 0;
            try
            {
                fbdRelease.Description  = "Select Release Directory";
                fbdRelease.SelectedPath = releaseStartDir;

                if (fbdRelease.ShowDialog() == DialogResult.OK)
                {
                    tbRelease.Text = fbdRelease.SelectedPath;
                    ri             = l.processRelease(fbdRelease.SelectedPath);
                    if (ri.Name != null)
                    {
                        if (ri.Type == "tv")
                        {
                            tbOutput.Text = tvDir + @"\" + ri.ShowName;
                        }
                        else
                        {
                            tbOutput.Text = outputDir;
                        }
                        setArchiveDetails();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Release Browse Error: " + ex.Message);
            }
            fbdRelease.Dispose();
            //this.ActiveControl = tbRelease;
        }
示例#2
0
 private void Form1_Shown(object sender, EventArgs e)
 {
     //System.Threading.Thread.Sleep(1000);
     if (args.Length > 1)
     {
         ri             = l.processRelease(args[1]);
         tbRelease.Text = args[1];
         setArchiveDetails();
         if (ri.Type == "tv")
         {
             tbOutput.Text = tvDir + @"\" + ri.ShowName;
             l.extractRelease(ri, tbOutput.Text, this, true);
         }
         else
         {
             tbOutput.Text = outputDir;
             l.extractRelease(ri, outputDir, this, true);
         }
     }
 }