mirror of
https://github.com/4sval/FModel.git
synced 2026-03-21 17:24:26 -05:00
This commit is contained in:
parent
0ae8386316
commit
aa41224d57
|
|
@ -142,7 +142,7 @@ public partial class App
|
|||
if (messageBox.Result == MessageBoxResult.Custom && (EErrorKind) messageBox.ButtonPressed.Id != EErrorKind.Ignore)
|
||||
{
|
||||
if ((EErrorKind) messageBox.ButtonPressed.Id == EErrorKind.ResetSettings)
|
||||
UserSettings.Default = new UserSettings();
|
||||
UserSettings.Delete();
|
||||
|
||||
ApplicationService.ApplicationView.Restart();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,16 +32,21 @@ namespace FModel.Settings
|
|||
Default = new UserSettings();
|
||||
}
|
||||
|
||||
private static bool _bSave = true;
|
||||
public static void Save()
|
||||
{
|
||||
if (Default == null) return;
|
||||
if (!_bSave || Default == null) return;
|
||||
Default.PerDirectory[Default.CurrentDir.GameDirectory] = Default.CurrentDir;
|
||||
File.WriteAllText(FilePath, JsonConvert.SerializeObject(Default, Formatting.Indented));
|
||||
}
|
||||
|
||||
public static void Delete()
|
||||
{
|
||||
if (File.Exists(FilePath)) File.Delete(FilePath);
|
||||
if (File.Exists(FilePath))
|
||||
{
|
||||
_bSave = false;
|
||||
File.Delete(FilePath);
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsEndpointValid(EEndpointType type, out EndpointSettings endpoint)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user