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:
Clint Rutkas
2020-08-05 14:06:42 -07:00
committed by GitHub
parent 30b65028fe
commit 92a2b83bc8
50 changed files with 308 additions and 116 deletions

View File

@@ -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 + ";

View File

@@ -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
}
}
}