示例#1
0
        private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (GetDownloading())
            {
                string text = "Files are being downloaded/converted/cut.\n\nAre you sure you want to quit?";

                if (MessageBox.Show(this, text, "Confirmation",
                                    MessageBoxButtons.YesNo,
                                    MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    // Hide form while waiting for threads to finish,
                    // except downloads which will abort.
                    CancelOperations();
                }

                e.Cancel = true;
                return;
            }

            SettingsEx.WindowStates[this.Name].SaveForm(this);

            SettingsEx.SaveToDirectories.Clear();

            string[] paths = new string[cbSaveTo.Items.Count];
            cbSaveTo.Items.CopyTo(paths, 0);

            SettingsEx.SaveToDirectories.AddRange(paths);
            SettingsEx.SelectedDirectory = cbSaveTo.SelectedIndex;

            SettingsEx.AutoConvert = chbAutoConvert.Checked;
            SettingsEx.AutoDelete  = cbAutoDelete.Checked;

            SettingsEx.Save();
        }
示例#2
0
 private void Options_FormClosing(object sender, FormClosingEventArgs e)
 {
     SettingsEx.DefaultDirectory = txtDefaultDirectory.Text;
     SettingsEx.SaveToDirectories.Insert(0, txtDefaultDirectory.Text);
     SettingsEx.AutoConvert = chbAutoConvert.Checked;
     SettingsEx.AutoDelete  = cbAutoDelete.Checked;
     SettingsEx.Save();
     Application.Restart();
 }
示例#3
0
        public MainForm()
        {
            InitializeComponent();
            InitializeMainMenu();

            lvQueue.ContextMenu = contextMenu1;

            SettingsEx.Load();
        }