[Analyzers] Update StyleCop and enable SA1200 (#22707)

* update StyleCop and enable SA1200

* Fix merge issues

* fix build and added using rule
This commit is contained in:
Davide Giacometti
2022-12-18 14:27:14 +01:00
committed by GitHub
parent 617150cf50
commit 6d138e80fb
55 changed files with 338 additions and 371 deletions

View File

@@ -2,12 +2,12 @@
// 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 PowerToys.PowerAccentKeyboardService;
using Windows.Globalization;
namespace PowerAccent.Core
{
using System;
using PowerToys.PowerAccentKeyboardService;
using Windows.Globalization;
public enum Language
{
ALL,

View File

@@ -100,7 +100,8 @@ public class PowerAccent : IDisposable
{
OnChangeDisplay?.Invoke(true, _characters);
}
}, TaskScheduler.FromCurrentSynchronizationContext());
},
TaskScheduler.FromCurrentSynchronizationContext());
}
private string GetCharacterDescription(string character)

View File

@@ -2,16 +2,14 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace PowerAccent.Core.Services;
using System.IO.Abstractions;
using System.Text.Json;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.Library.Enumerations;
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
using PowerToys.PowerAccentKeyboardService;
using System.IO.Abstractions;
using System.Text.Json;
using static Vanara.PInvoke.LANGID;
namespace PowerAccent.Core.Services;
public class SettingsService
{
private const string PowerAccentModuleName = "QuickAccent";

View File

@@ -41,7 +41,7 @@ internal static class WindowsFunctions
public static Point GetCaretPosition()
{
User32.GUITHREADINFO guiInfo = new ();
User32.GUITHREADINFO guiInfo = default;
guiInfo.cbSize = (uint)Marshal.SizeOf(guiInfo);
User32.GetGUIThreadInfo(0, ref guiInfo);
POINT caretPosition = new POINT(guiInfo.rcCaret.left, guiInfo.rcCaret.top);
@@ -59,12 +59,12 @@ internal static class WindowsFunctions
public static (Point Location, Size Size, double Dpi) GetActiveDisplay()
{
User32.GUITHREADINFO guiInfo = new ();
User32.GUITHREADINFO guiInfo = default;
guiInfo.cbSize = (uint)Marshal.SizeOf(guiInfo);
User32.GetGUIThreadInfo(0, ref guiInfo);
var res = User32.MonitorFromWindow(guiInfo.hwndActive, User32.MonitorFlags.MONITOR_DEFAULTTONEAREST);
User32.MONITORINFO monitorInfo = new ();
User32.MONITORINFO monitorInfo = default;
monitorInfo.cbSize = (uint)Marshal.SizeOf(monitorInfo);
User32.GetMonitorInfo(res, ref monitorInfo);