diff --git a/CreamInstaller/Components/CustomTreeView.cs b/CreamInstaller/Components/CustomTreeView.cs index 5addf7c..82d0bd6 100644 --- a/CreamInstaller/Components/CustomTreeView.cs +++ b/CreamInstaller/Components/CustomTreeView.cs @@ -195,7 +195,7 @@ internal sealed class CustomTreeView : TreeView _ = comboBoxBounds.Remove(pair.Key); else if (pair.Value.Contains(clickPoint)) { - List proxies = EmbeddedResources.FindAll(r => r.StartsWith("Koaloader")).Select(p => + List proxies = EmbeddedResources.FindAll(r => r.StartsWith("Koaloader", StringComparison.Ordinal)).Select(p => { p.GetProxyInfoFromIdentifier(out string proxyName, out _); return proxyName; diff --git a/CreamInstaller/Forms/SelectForm.cs b/CreamInstaller/Forms/SelectForm.cs index fd49402..951044f 100644 --- a/CreamInstaller/Forms/SelectForm.cs +++ b/CreamInstaller/Forms/SelectForm.cs @@ -769,30 +769,9 @@ internal sealed partial class SelectForm : CustomForm items.Add(query); items.Add(new ContextMenuItem("Refresh Queries", "Command Prompt", (_, _) => { - try - { - appInfoVDF.Delete(); - } - catch - { - // ignored - } - try - { - appInfoJSON.Delete(); - } - catch - { - // ignored - } - try - { - cooldown.Delete(); - } - catch - { - // ignored - } + appInfoVDF.Delete(); + appInfoJSON.Delete(); + cooldown.Delete(); OnLoad(true); })); } diff --git a/CreamInstaller/GlobalSuppressions.cs b/CreamInstaller/GlobalSuppressions.cs deleted file mode 100644 index 18fd301..0000000 --- a/CreamInstaller/GlobalSuppressions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'")] -[assembly: SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression")] - -[assembly: SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters")] -[assembly: SuppressMessage("Globalization", "CA1305:Specify IFormatProvider")] -[assembly: SuppressMessage("Globalization", "CA1307:Specify StringComparison for clarity")] -[assembly: SuppressMessage("Globalization", "CA1310:Specify StringComparison for correctness")] - -[assembly: SuppressMessage("Design", "CA1031:Do not catch general exception types")] - -[assembly: SuppressMessage("Reliability", "CA2007:Consider calling ConfigureAwait on the awaited task")] \ No newline at end of file diff --git a/CreamInstaller/Platforms/Epic/EpicLibrary.cs b/CreamInstaller/Platforms/Epic/EpicLibrary.cs index 9eeed6e..f390ab7 100644 --- a/CreamInstaller/Platforms/Epic/EpicLibrary.cs +++ b/CreamInstaller/Platforms/Epic/EpicLibrary.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.Json; @@ -21,7 +22,7 @@ internal static class EpicLibrary epicManifestsPath ??= Registry.GetValue(@"HKEY_CURRENT_USER\Software\Wow6432Node\Epic Games\EOS", "ModSdkMetadataDir", null) as string; epicManifestsPath ??= Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Epic Games\EpicGamesLauncher", "AppDataPath", null) as string; epicManifestsPath ??= Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Epic Games\EpicGamesLauncher", "AppDataPath", null) as string; - if (epicManifestsPath is not null && epicManifestsPath.EndsWith(@"\Data")) + if (epicManifestsPath is not null && epicManifestsPath.EndsWith(@"\Data", StringComparison.Ordinal)) epicManifestsPath += @"\Manifests"; return epicManifestsPath.BeautifyPath(); } diff --git a/CreamInstaller/Platforms/Steam/SteamStore.cs b/CreamInstaller/Platforms/Steam/SteamStore.cs index 8f0fdd3..44a28dc 100644 --- a/CreamInstaller/Platforms/Steam/SteamStore.cs +++ b/CreamInstaller/Platforms/Steam/SteamStore.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -23,7 +24,7 @@ internal static class SteamStore List dlcIds = new(); if (appData.dlc is null) return dlcIds; - dlcIds.AddRange(from appId in appData.dlc where appId > 0 select appId.ToString()); + dlcIds.AddRange(from appId in appData.dlc where appId > 0 select appId.ToString(CultureInfo.InvariantCulture)); return dlcIds; }); diff --git a/CreamInstaller/Resources/Koaloader.cs b/CreamInstaller/Resources/Koaloader.cs index 810244d..ed11585 100644 --- a/CreamInstaller/Resources/Koaloader.cs +++ b/CreamInstaller/Resources/Koaloader.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -37,7 +38,7 @@ internal static class Koaloader private static void WriteProxy(this string path, string proxyName, BinaryType binaryType) { - foreach (string resourceIdentifier in EmbeddedResources.FindAll(r => r.StartsWith("Koaloader"))) + foreach (string resourceIdentifier in EmbeddedResources.FindAll(r => r.StartsWith("Koaloader", StringComparison.Ordinal))) { resourceIdentifier.GetProxyInfoFromIdentifier(out string _proxyName, out BinaryType _binaryType); if (_proxyName != proxyName || _binaryType != binaryType) diff --git a/CreamInstaller/Resources/Resources.cs b/CreamInstaller/Resources/Resources.cs index f86bc52..7eeefec 100644 --- a/CreamInstaller/Resources/Resources.cs +++ b/CreamInstaller/Resources/Resources.cs @@ -431,7 +431,7 @@ internal static class Resources return embeddedResources; string[] names = Assembly.GetExecutingAssembly().GetManifestResourceNames(); embeddedResources = new(); - foreach (string resourceName in names.Where(n => n.StartsWith("CreamInstaller.Resources."))) + foreach (string resourceName in names.Where(n => n.StartsWith("CreamInstaller.Resources.", StringComparison.Ordinal))) embeddedResources.Add(resourceName[25..]); return embeddedResources; }