mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +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:
@@ -10,6 +10,7 @@ using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using Microsoft.PowerToys.Run.Plugin.System.Properties;
|
||||
|
||||
namespace Microsoft.PowerToys.Run.Plugin.System.Components
|
||||
@@ -114,6 +115,9 @@ namespace Microsoft.PowerToys.Run.Plugin.System.Components
|
||||
/// </summary>
|
||||
internal IPAddressCollection WinsServers { get; private set; }
|
||||
|
||||
private static readonly CompositeFormat MicrosoftPluginSysGbps = CompositeFormat.Parse(Properties.Resources.Microsoft_plugin_sys_Gbps);
|
||||
private static readonly CompositeFormat MicrosoftPluginSysMbps = CompositeFormat.Parse(Properties.Resources.Microsoft_plugin_sys_Mbps);
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NetworkConnectionProperties"/> class.
|
||||
/// This private constructor is used when we crete the list of adapter (properties) by calling <see cref="NetworkConnectionProperties.GetList()"/>.
|
||||
@@ -286,7 +290,7 @@ namespace Microsoft.PowerToys.Run.Plugin.System.Components
|
||||
/// <returns>A formatted string like `100 MB/s`</returns>
|
||||
private static string GetFormattedSpeedValue(long speed)
|
||||
{
|
||||
return (speed >= 1000000000) ? string.Format(CultureInfo.InvariantCulture, Resources.Microsoft_plugin_sys_Gbps, speed / 1000000000) : string.Format(CultureInfo.InvariantCulture, Resources.Microsoft_plugin_sys_Mbps, speed / 1000000);
|
||||
return (speed >= 1000000000) ? string.Format(CultureInfo.InvariantCulture, MicrosoftPluginSysGbps, speed / 1000000000) : string.Format(CultureInfo.InvariantCulture, MicrosoftPluginSysMbps, speed / 1000000);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user