private void Application_Exit(object sender, ExitEventArgs e) { PreferencesHelper.SavePrefs("preferences.xml"); }