mirror of
https://github.com/SlothDpal/Relaunch-Process.git
synced 2026-02-22 17:27:38 +03:00
перенос настроек из старо сборки в новую через settings.upgrade
This commit is contained in:
20
Form1.cs
20
Form1.cs
@@ -15,7 +15,7 @@ using RelaunchProcess;
|
||||
using System.Timers;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
using System.Configuration;
|
||||
|
||||
namespace Process_Auto_Relaunch
|
||||
{
|
||||
@@ -47,6 +47,24 @@ namespace Process_Auto_Relaunch
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
if (Settings.Default.upgradeSettings)
|
||||
{
|
||||
Debug.WriteLine("Обновление настроек.");
|
||||
try
|
||||
{
|
||||
Settings.Default.Upgrade();
|
||||
}
|
||||
catch (ConfigurationErrorsException ex)
|
||||
{
|
||||
Debug.WriteLine($"Ошибка обновления настроек: {ex.Message}");
|
||||
Settings.Default.Reset();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Settings.Default.upgradeSettings = false;
|
||||
Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
this.updateLogDelegate = this.UpdateStatus;
|
||||
this.updateLogDelegate += this.SendDiscordMessage;
|
||||
this.updateLogDelegate += this.HistoryLog;
|
||||
|
||||
Reference in New Issue
Block a user