From 8a594ab8d166d2e44d8b07c77b4e6276cb23912b Mon Sep 17 00:00:00 2001 From: Laurence Luo Date: Wed, 18 Sep 2024 17:35:20 +0800 Subject: [PATCH] Update --- KindleMate2/FrmMain.cs | 14 +++++++++++++- KindleMate2/{KM2.dat => KM.dat} | Bin KindleMate2/KindleMate2.csproj | 6 +++--- 3 files changed, 16 insertions(+), 4 deletions(-) rename KindleMate2/{KM2.dat => KM.dat} (100%) diff --git a/KindleMate2/FrmMain.cs b/KindleMate2/FrmMain.cs index 0aa1f00..0103f2f 100644 --- a/KindleMate2/FrmMain.cs +++ b/KindleMate2/FrmMain.cs @@ -19,7 +19,7 @@ public partial class FrmMain : Form { private DataTable _lookupsDataTable = new(); - private readonly StaticData _staticData = new(); + private readonly StaticData _staticData; private readonly string _programsDirectory; @@ -46,6 +46,18 @@ public partial class FrmMain : Form { public FrmMain() { InitializeComponent(); + try { + if (File.Exists(Path.Combine(Environment.CurrentDirectory, "KM2.dat"))) { + File.Delete(Path.Combine(Environment.CurrentDirectory, "KM.dat")); + } else { + File.Copy(Path.Combine(Environment.CurrentDirectory, "KM.dat"), Path.Combine(Environment.CurrentDirectory, "KM2.dat")); + } + } catch (Exception e) { + Messenger.MessageBox(e.Message, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); + Close(); + } + _staticData = new StaticData(); + SetTheme(); treeViewBooks.ContextMenuStrip = menu; diff --git a/KindleMate2/KM2.dat b/KindleMate2/KM.dat similarity index 100% rename from KindleMate2/KM2.dat rename to KindleMate2/KM.dat diff --git a/KindleMate2/KindleMate2.csproj b/KindleMate2/KindleMate2.csproj index 3176d6a..a8204ac 100644 --- a/KindleMate2/KindleMate2.csproj +++ b/KindleMate2/KindleMate2.csproj @@ -23,7 +23,7 @@ latest https://github.com/lzcapp/KindleMate2/blob/main/LICENSE - 2024.9.13 + 2024.9.18 false @@ -212,8 +212,8 @@ - - PreserveNewest + + Always Always