mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
smaller stylecop fixes in Wox.Core and Wox.Infra (#5671)
* Headers unneeded usings files need blank line at bottom Fixed double returns Returns after braces * commenting out stylecop
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
using System;
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// 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.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Input;
|
||||
@@ -13,7 +17,6 @@ namespace Wox.Infrastructure.Hotkey
|
||||
public bool Ctrl { get; set; }
|
||||
public Key CharKey { get; set; }
|
||||
|
||||
|
||||
Dictionary<Key, string> specialSymbolDictionary = new Dictionary<Key, string>
|
||||
{
|
||||
{Key.Space, "Space"},
|
||||
@@ -29,18 +32,22 @@ namespace Wox.Infrastructure.Hotkey
|
||||
{
|
||||
modifierKeys = ModifierKeys.Alt;
|
||||
}
|
||||
|
||||
if (Shift)
|
||||
{
|
||||
modifierKeys = modifierKeys | ModifierKeys.Shift;
|
||||
}
|
||||
|
||||
if (Win)
|
||||
{
|
||||
modifierKeys = modifierKeys | ModifierKeys.Windows;
|
||||
}
|
||||
|
||||
if (Ctrl)
|
||||
{
|
||||
modifierKeys = modifierKeys | ModifierKeys.Control;
|
||||
}
|
||||
|
||||
return modifierKeys;
|
||||
}
|
||||
}
|
||||
@@ -70,27 +77,32 @@ namespace Wox.Infrastructure.Hotkey
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<string> keys = hotkeyString.Replace(" ", "").Split('+').ToList();
|
||||
if (keys.Contains("Alt"))
|
||||
{
|
||||
Alt = true;
|
||||
keys.Remove("Alt");
|
||||
}
|
||||
|
||||
if (keys.Contains("Shift"))
|
||||
{
|
||||
Shift = true;
|
||||
keys.Remove("Shift");
|
||||
}
|
||||
|
||||
if (keys.Contains("Win"))
|
||||
{
|
||||
Win = true;
|
||||
keys.Remove("Win");
|
||||
}
|
||||
|
||||
if (keys.Contains("Ctrl"))
|
||||
{
|
||||
Ctrl = true;
|
||||
keys.Remove("Ctrl");
|
||||
}
|
||||
|
||||
if (keys.Count > 0)
|
||||
{
|
||||
string charKey = keys[0];
|
||||
@@ -120,14 +132,17 @@ namespace Wox.Infrastructure.Hotkey
|
||||
{
|
||||
text += "Ctrl + ";
|
||||
}
|
||||
|
||||
if (Alt)
|
||||
{
|
||||
text += "Alt + ";
|
||||
}
|
||||
|
||||
if (Shift)
|
||||
{
|
||||
text += "Shift + ";
|
||||
}
|
||||
|
||||
if (Win)
|
||||
{
|
||||
text += "Win + ";
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
namespace Wox.Infrastructure.Hotkey
|
||||
{
|
||||
public enum KeyEvent
|
||||
@@ -22,4 +26,4 @@ namespace Wox.Infrastructure.Hotkey
|
||||
/// </summary>
|
||||
WM_SYSKEYDOWN = 260
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user