diff --git a/JL.Core/Config/StatsDBUtils.cs b/JL.Core/Config/StatsDBUtils.cs index 84779ce0..2040b5e2 100644 --- a/JL.Core/Config/StatsDBUtils.cs +++ b/JL.Core/Config/StatsDBUtils.cs @@ -12,7 +12,7 @@ public static void InsertStats(SqliteConnection connection, Stats stats, int pro InsertStats(connection, JsonSerializer.Serialize(stats, Utils.s_jsoWithEnumConverterAndIndentation), profileId); } - public static void InsertStats(SqliteConnection connection, string stats, int profileId) + private static void InsertStats(SqliteConnection connection, string stats, int profileId) { using SqliteCommand command = connection.CreateCommand(); command.CommandText = @@ -31,7 +31,7 @@ private static void UpdateStats(SqliteConnection connection, Stats stats, int pr UpdateStats(connection, JsonSerializer.Serialize(stats, Utils.s_jsoWithEnumConverterAndIndentation), profileId); } - public static void UpdateStats(SqliteConnection connection, string stats, int profileId) + private static void UpdateStats(SqliteConnection connection, string stats, int profileId) { using SqliteCommand command = connection.CreateCommand(); command.CommandText = diff --git a/JL.Core/Utilities/ExtensionMethods.cs b/JL.Core/Utilities/ExtensionMethods.cs index 63d88584..5c2ffa33 100644 --- a/JL.Core/Utilities/ExtensionMethods.cs +++ b/JL.Core/Utilities/ExtensionMethods.cs @@ -48,10 +48,10 @@ internal static List ListUnicodeCharacters(this ReadOnlySpan text) if (char.IsHighSurrogate(highSurrogateCandidate) && text.Length > i + 1) { - char lowSurragateCandidate = text[i + 1]; - if (char.IsLowSurrogate(lowSurragateCandidate)) + char lowSurrogateCandidate = text[i + 1]; + if (char.IsLowSurrogate(lowSurrogateCandidate)) { - textBlocks.Add(char.ConvertFromUtf32(char.ConvertToUtf32(highSurrogateCandidate, lowSurragateCandidate))); + textBlocks.Add(char.ConvertFromUtf32(char.ConvertToUtf32(highSurrogateCandidate, lowSurrogateCandidate))); ++i; } else diff --git a/JL.Windows/ConfigManager.cs b/JL.Windows/ConfigManager.cs index 78cc0a5a..169b5480 100644 --- a/JL.Windows/ConfigManager.cs +++ b/JL.Windows/ConfigManager.cs @@ -1290,14 +1290,14 @@ public static void SaveBeforeClosing() double mainWindowTopPosition = MainWindow.Instance.Top >= SystemParameters.VirtualScreenTop ? MainWindow.Instance.Top + MainWindow.Instance.Height <= SystemParameters.VirtualScreenTop + SystemParameters.VirtualScreenHeight - ? (MainWindow.Instance.Top * WindowsUtils.Dpi.DpiScaleY) + ? MainWindow.Instance.Top * WindowsUtils.Dpi.DpiScaleY : Math.Max(SystemParameters.VirtualScreenTop, SystemParameters.VirtualScreenTop + SystemParameters.VirtualScreenHeight - MainWindow.Instance.Height) * WindowsUtils.Dpi.DpiScaleY : WindowsUtils.ActiveScreen.Bounds.Y; ConfigDBManager.UpdateSetting(connection, "MainWindowTopPosition", mainWindowTopPosition.ToString(CultureInfo.InvariantCulture)); double mainWindowLeftPosition = MainWindow.Instance.Left >= SystemParameters.VirtualScreenLeft ? MainWindow.Instance.Left + MainWindow.Instance.Width <= SystemParameters.VirtualScreenLeft + SystemParameters.VirtualScreenWidth - ? (MainWindow.Instance.Left * WindowsUtils.Dpi.DpiScaleX) + ? MainWindow.Instance.Left * WindowsUtils.Dpi.DpiScaleX : Math.Max(SystemParameters.VirtualScreenLeft, SystemParameters.VirtualScreenLeft + SystemParameters.VirtualScreenWidth - MainWindow.Instance.Width) * WindowsUtils.Dpi.DpiScaleX : WindowsUtils.ActiveScreen.Bounds.X; ConfigDBManager.UpdateSetting(connection, "MainWindowLeftPosition", mainWindowLeftPosition.ToString(CultureInfo.InvariantCulture)); diff --git a/JL.Windows/GUI/PopupWindow.xaml.cs b/JL.Windows/GUI/PopupWindow.xaml.cs index a83f63d8..e516f2d1 100644 --- a/JL.Windows/GUI/PopupWindow.xaml.cs +++ b/JL.Windows/GUI/PopupWindow.xaml.cs @@ -1086,6 +1086,7 @@ private void ListViewItem_MouseEnter(object sender, MouseEventArgs e) } } + // ReSharper disable once MemberCanBeMadeStatic.Local private void Unselect(object sender, RoutedEventArgs e) { WindowsUtils.Unselect((TextBox)sender); diff --git a/JL.Windows/Utilities/WindowsUtils.cs b/JL.Windows/Utilities/WindowsUtils.cs index 14c7ec60..57ee3db2 100644 --- a/JL.Windows/Utilities/WindowsUtils.cs +++ b/JL.Windows/Utilities/WindowsUtils.cs @@ -321,7 +321,7 @@ public static async Task UpdateJL(Uri latestReleaseUrl) archive.ExtractToDirectory(tmpDirectory); } - await Application.Current.Dispatcher.Invoke(async () => await MainWindow.Instance.HandleAppClosing().ConfigureAwait(false)).ConfigureAwait(false); + await Application.Current.Dispatcher.Invoke(static () => MainWindow.Instance.HandleAppClosing()).ConfigureAwait(false); _ = Process.Start( new ProcessStartInfo("cmd",