mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[PreviewPane] Enable analyzer and fix warnings (#16995)
This commit is contained in:
committed by
GitHub
parent
bf3e427017
commit
7365ba14d0
@@ -3,6 +3,7 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System.Reflection;
|
||||
using Common;
|
||||
using Microsoft.PowerToys.STATestExtension;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using PreviewHandlerCommon;
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Common.Utilities
|
||||
|
||||
if (buffer == null)
|
||||
{
|
||||
throw new NullReferenceException("buffer is null");
|
||||
throw new ArgumentNullException(nameof(buffer), "buffer is null");
|
||||
}
|
||||
|
||||
if (offset < 0 || count < 0 || (offset + count) > buffer.Length)
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
using System;
|
||||
|
||||
namespace Common
|
||||
{
|
||||
/// <summary>
|
||||
/// Flags to control download and execution in Web Browser Control.
|
||||
/// Values of flags are defined in mshtmdid.h in distributed Windows Sdk.
|
||||
@@ -107,3 +109,4 @@ public enum WebBrowserDownloadControlFlags : int
|
||||
/// </summary>
|
||||
SILENT = 0x40000000,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using System;
|
||||
using System.Globalization;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
|
||||
namespace PreviewHandlerCommon
|
||||
{
|
||||
@@ -52,7 +53,7 @@ namespace PreviewHandlerCommon
|
||||
{
|
||||
object result;
|
||||
|
||||
if (name != null && name.Equals(DISPIDAMBIENTDLCONTROL, StringComparison.CurrentCulture))
|
||||
if (name != null && name.Equals(DISPIDAMBIENTDLCONTROL, StringComparison.Ordinal))
|
||||
{
|
||||
// Using InvariantCulture since this is used for web browser configurations
|
||||
result = Convert.ToInt32(
|
||||
|
||||
Reference in New Issue
Block a user