Пример #1
0
        private void RainTube_FormClosing(object sender, FormClosingEventArgs e)
        {
            foreach (Form f in this.MdiChildren)
            {
                try
                {
                    f.Close();
                }
                catch { }
            }
            if (isCondensing)
            {
                isCondensing = false;
                e.Cancel     = true;
                this.Invoke((MethodInvoker) delegate
                {
                    this.IsMdiContainer = false;
                    this.Size           = new Size(499, 436);
                    //this.FormBorderStyle = FormBorderStyle.Fixed3D;
                    this.Text = "RainDrop - Condensing the Cloud";
                    //this.WindowState = FormWindowState.Normal;
                    this.textBox1.ReadOnly = false;
                    //this.button1.Text = b1t;
                    this.button1.Enabled = true;
                    this.textBox1.Focus();
                    this.isCondensing = false;
                });

                /*try
                 * {
                 *  new Thread(new ThreadStart(delegate
                 *  {
                 *      Thread.Sleep(5000);
                 *      DirectoryInfo di = new DirectoryInfo(textBox2.Text.ToString());
                 *      //FileInfo[] files = di.GetFiles("*.raindrop").Where(p => p.Extension == ".msi").ToArray();
                 *      foreach (FileInfo file in di.GetFiles("*.raindrop").Where(p => p.Extension == ".msi").ToArray())
                 *      {
                 *          try
                 *          {
                 *              //file.Attributes
                 *              File.Delete(file.FullName);
                 *              MessageBox.Show(file.FullName);
                 *          }
                 *          catch { }
                 *      }
                 *  })).Start();
                 * }
                 * catch { }*/
            }
            else
            {
                Properties.Settings.Default.LastPath  = this.textBox2.Text;
                Properties.Settings.Default.PreferAC3 = this.preferAC3.Checked;
                Properties.Settings.Default.PreferACC = this.preferAAC.Checked;
                Properties.Settings.Default.PreferOGG = this.preferOGG.Checked;
                Properties.Settings.Default.PreferMP3 = this.preferMP3.Checked;
                try
                {
                    Properties.Settings.Default.MaxRaindrops = int.Parse(this.comboBox1.Text.ToString());
                }
                catch { }
                Properties.Settings.Default.Save();
                try
                {
                    //File.Delete(System.Reflection.Assembly.GetExecutingAssembly().CodeBase + "ffmpeg.exe");
                    File.Delete(Directory.GetCurrentDirectory() + "\\ffmpeg.exe");
                }
                catch { }
                Environment.Exit(0);
            }
        }