2015-07-14 18:43:24 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Threading;
|
|
|
|
|
|
|
|
|
|
namespace GameRes.Formats.Properties {
|
2014-07-21 23:26:28 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// This class allows you to handle specific events on the settings class:
|
|
|
|
|
// The SettingChanging event is raised before a setting's value is changed.
|
|
|
|
|
// The PropertyChanged event is raised after a setting's value is changed.
|
|
|
|
|
// The SettingsLoaded event is raised after the setting values are loaded.
|
|
|
|
|
// The SettingsSaving event is raised before the setting values are saved.
|
|
|
|
|
public sealed partial class Settings {
|
|
|
|
|
|
|
|
|
|
public Settings() {
|
|
|
|
|
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
|
|
|
|
//
|
|
|
|
|
// this.SettingChanging += this.SettingChangingEventHandler;
|
|
|
|
|
//
|
|
|
|
|
// this.SettingsSaving += this.SettingsSavingEventHandler;
|
|
|
|
|
//
|
|
|
|
|
|
2015-07-14 18:43:24 +04:00
|
|
|
|
if (null != Application.Current)
|
|
|
|
|
{
|
|
|
|
|
Application.Current.Dispatcher.BeginInvoke (DispatcherPriority.Normal, new Action(() => {
|
|
|
|
|
Application.Current.Exit += ApplicationExitHandler;
|
|
|
|
|
}));
|
|
|
|
|
}
|
2014-07-21 23:26:28 +04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ApplicationExitHandler (object sender, System.Windows.ExitEventArgs args)
|
|
|
|
|
{
|
|
|
|
|
Default.Save();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
|
|
|
|
|
// Add code to handle the SettingChangingEvent event here.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
|
|
|
|
|
// Add code to handle the SettingsSaving event here.
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|