private void preferencesToolStripMenuItem_Click(object sender, EventArgs e) { PreferencesForm preferences = new PreferencesForm(_config); DialogResult result = preferences.ShowDialog(); if (result == DialogResult.OK) { _config = preferences.Config; _config.Serialize(Path.Combine(_appDataFolder, _configName)); } preferences.Dispose(); }