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(); }
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(); }
public MainForm() { InitializeComponent(); InitializeMainMenu(); lvQueue.ContextMenu = contextMenu1; SettingsEx.Load(); }