mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
.NET 8 Upgrade Silenced Errors Fix (#30469)
* [Dev][Build] .NET 8 Upgrade Silenced errors first fix. * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1859 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1854. * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1860 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1861 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1862 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1863 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1864 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA1865 * [Dev][Build] .NET 8 Upgrade Silenced errors. CA2208 * [Dev][Build] .NET 8 Upgrade Silenced errors. CS9191 * [Dev][Build] .NET 8 Upgrade Silenced errors. Spell check * [Dev][Build] .NET 8 Upgrade Silenced errors. Spell check * [Dev][Build] .NET 8 Upgrade Silenced errors. - CompositeFormat variables used more than once in the same file were assigned to a single variable. - GetProcessesByName logic fix. - String comparion fix. - ArgumentOutOfRangeException message change. * [Dev][Build] .NET 8 Upgrade Silenced errors. - Null check added. - static readonly CompositeFormat added for all fields.
This commit is contained in:
@@ -11,6 +11,7 @@ using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Windows.Input;
|
||||
using ManagedCommon;
|
||||
using Microsoft.Plugin.Shell.Properties;
|
||||
@@ -33,6 +34,8 @@ namespace Microsoft.Plugin.Shell
|
||||
private readonly ShellPluginSettings _settings;
|
||||
private readonly PluginJsonStorage<ShellPluginSettings> _storage;
|
||||
|
||||
private static readonly CompositeFormat WoxPluginCmdCmdHasBeenExecutedTimes = System.Text.CompositeFormat.Parse(Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times);
|
||||
|
||||
private string IconPath { get; set; }
|
||||
|
||||
public string Name => Properties.Resources.wox_plugin_cmd_plugin_name;
|
||||
@@ -71,6 +74,7 @@ namespace Microsoft.Plugin.Shell
|
||||
};
|
||||
|
||||
private PluginInitContext _context;
|
||||
private static readonly char[] Separator = new[] { ' ' };
|
||||
|
||||
public Main()
|
||||
{
|
||||
@@ -123,7 +127,7 @@ namespace Microsoft.Plugin.Shell
|
||||
if (m.Key == cmd)
|
||||
{
|
||||
// Using CurrentCulture since this is user facing
|
||||
result.SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times, m.Value);
|
||||
result.SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, WoxPluginCmdCmdHasBeenExecutedTimes, m.Value);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -132,7 +136,7 @@ namespace Microsoft.Plugin.Shell
|
||||
Title = m.Key,
|
||||
|
||||
// Using CurrentCulture since this is user facing
|
||||
SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times, m.Value),
|
||||
SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, WoxPluginCmdCmdHasBeenExecutedTimes, m.Value),
|
||||
IcoPath = IconPath,
|
||||
Action = c =>
|
||||
{
|
||||
@@ -171,7 +175,7 @@ namespace Microsoft.Plugin.Shell
|
||||
Title = m.Key,
|
||||
|
||||
// Using CurrentCulture since this is user facing
|
||||
SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_cmd_cmd_has_been_executed_times, m.Value),
|
||||
SubTitle = Properties.Resources.wox_plugin_cmd_plugin_name + ": " + string.Format(CultureInfo.CurrentCulture, WoxPluginCmdCmdHasBeenExecutedTimes, m.Value),
|
||||
IcoPath = IconPath,
|
||||
Action = c =>
|
||||
{
|
||||
@@ -285,7 +289,7 @@ namespace Microsoft.Plugin.Shell
|
||||
}
|
||||
else
|
||||
{
|
||||
var parts = command.Split(new[] { ' ' }, 2);
|
||||
var parts = command.Split(Separator, 2);
|
||||
if (parts.Length == 2)
|
||||
{
|
||||
var filename = parts[0];
|
||||
|
||||
Reference in New Issue
Block a user