SettingsManager - Moved private function to the bottom of the class for readability

This commit is contained in:
miku-666
2023-06-16 16:56:26 +02:00
parent 4148f56683
commit 03af825270

View File

@@ -16,23 +16,6 @@ namespace PckStudio.Internals
private static object _newValue = null;
private static void PropertyChangedHandler(object sender, PropertyChangedEventArgs e)
{
if (_onSettingChanged.ContainsKey(e.PropertyName))
{
_onSettingChanged[e.PropertyName]?.Invoke(_newValue);
_newValue = null;
}
}
private static void SettingChangingHandler(object sender, SettingChangingEventArgs e)
{
if (_onSettingChanged.ContainsKey(e.SettingName))
{
_newValue = e.NewValue;
}
}
internal static void Initialize()
{
Settings.Default.PropertyChanged += PropertyChangedHandler;
@@ -62,5 +45,21 @@ namespace PckStudio.Internals
return true;
}
private static void PropertyChangedHandler(object sender, PropertyChangedEventArgs e)
{
if (_onSettingChanged.ContainsKey(e.PropertyName))
{
_onSettingChanged[e.PropertyName]?.Invoke(_newValue);
_newValue = null;
}
}
private static void SettingChangingHandler(object sender, SettingChangingEventArgs e)
{
if (_onSettingChanged.ContainsKey(e.SettingName))
{
_newValue = e.NewValue;
}
}
}
}