mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
Fixed a crashing bug when the server manager closes and is unable to find the backup location to save the config settings.
This commit is contained in:
parent
34582ca91b
commit
9d5dafaed6
7 changed files with 37 additions and 10 deletions
|
|
@ -16,6 +16,11 @@
|
|||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">BUGFIX</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Fixed a crashing bug when ASM closes and is unable to find the backup location to save the config settings.</li>
|
||||
</ul>
|
||||
<u style="font-size: .9em;">NEW</u>
|
||||
<br/>
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@
|
|||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">BUGFIX</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Fixed a crashing bug when ASM closes and is unable to find the backup location to save the config settings.</li>
|
||||
</ul>
|
||||
<u style="font-size: .9em;">NEW</u>
|
||||
<br/>
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ namespace ServerManagerTool
|
|||
|
||||
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
if (this.WindowState != WindowState.Minimized)
|
||||
if (this.WindowState == WindowState.Normal)
|
||||
{
|
||||
Config.Default.MainWindow_Height = e.NewSize.Height;
|
||||
Config.Default.MainWindow_Width = e.NewSize.Width;
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@
|
|||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">BUGFIX</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Fixed a crashing bug when CSM closes and is unable to find the backup location to save the config settings.</li>
|
||||
</ul>
|
||||
<u style="font-size: .9em;">NEW</u>
|
||||
<br/>
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@
|
|||
<content type="xhtml">
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" style="font-family: Arial, Verdana, Helvetica, Sans-Serif;font-size: .8em;">
|
||||
<p>
|
||||
<u style="font-size: .9em;">BUGFIX</u>
|
||||
<br/>
|
||||
<ul>
|
||||
<li>Fixed a crashing bug when CSM closes and is unable to find the backup location to save the config settings.</li>
|
||||
</ul>
|
||||
<u style="font-size: .9em;">NEW</u>
|
||||
<br/>
|
||||
<ul>
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ namespace ServerManagerTool
|
|||
|
||||
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
if (this.WindowState != WindowState.Minimized)
|
||||
if (this.WindowState == WindowState.Normal)
|
||||
{
|
||||
Config.Default.MainWindow_Height = e.NewSize.Height;
|
||||
Config.Default.MainWindow_Width = e.NewSize.Width;
|
||||
|
|
|
|||
|
|
@ -47,18 +47,25 @@ namespace ServerManagerTool.Common.Utils
|
|||
// do nothing, just exit
|
||||
}
|
||||
|
||||
var filesToDelete = new DirectoryInfo(backupPath).GetFiles($"{settingsFileName}_*{settingsFileExt}").Where(f => f.LastWriteTimeUtc.AddDays(7) < DateTime.UtcNow).ToArray();
|
||||
foreach (var fileToDelete in filesToDelete)
|
||||
try
|
||||
{
|
||||
try
|
||||
var filesToDelete = new DirectoryInfo(backupPath).GetFiles($"{settingsFileName}_*{settingsFileExt}").Where(f => f.LastWriteTimeUtc.AddDays(7) < DateTime.UtcNow).ToArray();
|
||||
foreach (var fileToDelete in filesToDelete)
|
||||
{
|
||||
fileToDelete.Delete();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, just exit
|
||||
try
|
||||
{
|
||||
fileToDelete.Delete();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, just exit
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// do nothing, just exit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue