[Chore] Run solution code cleanup (#20584)

This commit is contained in:
Andrey Nekrasov
2022-09-16 11:54:58 +03:00
committed by GitHub
parent 09f4dead7f
commit ca3c758046
133 changed files with 108 additions and 359 deletions

View File

@@ -53,9 +53,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Gcode
{
using (var reader = new StreamReader(stream))
{
#pragma warning disable CA2000 // Do not dispose here
thumbnail = GetThumbnail(reader);
#pragma warning restore CA2000
}
}

View File

@@ -53,7 +53,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
{
if (disposing)
{
_markdownPreviewHandlerControl.Dispose();
_markdownPreviewHandlerControl.Dispose();
}
// TODO: free unmanaged resources (unmanaged objects) and override finalizer

View File

@@ -5,7 +5,6 @@
using System;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text.Json;
namespace Microsoft.PowerToys.PreviewHandler.Monaco

View File

@@ -5,9 +5,7 @@
using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Abstractions;
using interop;
namespace Microsoft.PowerToys.PreviewHandler.Monaco.Helpers
{

View File

@@ -3,11 +3,9 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using Common.ComInterlop;
using Microsoft.PowerToys.STATestExtension;
using Microsoft.PowerToys.ThumbnailHandler.Pdf;

View File

@@ -2,7 +2,6 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Drawing;
using System.Windows.Forms;

View File

@@ -7,7 +7,6 @@ using System.Drawing;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Text;
using System.Windows.Forms;
using Common.ComInterlop;
using Microsoft.PowerToys.STATestExtension;
using Microsoft.PowerToys.ThumbnailHandler.Svg;

View File

@@ -48,9 +48,7 @@ namespace Common.Utilities
foreach (XElement element in elements)
{
// Using Invariant since we are doing an exact match for HTML tags and we want it to behave the same in every culture
#pragma warning disable CA1308 // Normalize strings to uppercase
var elementName = element?.Name?.LocalName?.ToLowerInvariant();
#pragma warning restore CA1308 // Normalize strings to uppercase
if (elementName != null && blockedElementsName.ContainsKey(elementName))
{
foundBlockedElement = true;

View File

@@ -11,7 +11,6 @@ namespace Common.ComInterlop
/// The COLORREF value is used to specify an RGB color.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "Interop")]
public struct COLORREF
{
/// <summary>

View File

@@ -10,7 +10,6 @@ namespace Common.ComInterlop
/// <summary>
/// Specifies the alpha type of the image.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Naming", "CA1707:Identifiers should not contain underscores", Justification = "Interop")]
public enum WTS_ALPHATYPE : int
{
/// <summary>

View File

@@ -10,7 +10,6 @@ namespace Common.ComInterlop
/// Defines the attributes of a font.
/// </summary>
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "Interop")]
public struct LOGFONT
{
/// <summary>

View File

@@ -11,7 +11,6 @@ namespace Common.ComInterlop
/// Contains message information from a thread's message queue.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "Interop")]
public struct MSG
{
/// <summary>

View File

@@ -11,7 +11,6 @@ namespace Common.ComInterlop
/// The RECT structure defines a rectangle by the coordinates of its upper-left and lower-right corners.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1815:Override equals and operator equals on value types", Justification = "Interop")]
public struct RECT
{
/// <summary>

View File

@@ -4,7 +4,6 @@
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using PreviewHandlerCommon.ComInterop;

View File

@@ -5,9 +5,7 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.InteropServices;
using Common.ComInterlop;
using Microsoft.Win32;
namespace Common
{