Skip to content

Commit 3e24f05

Browse files
committed
Fix & Improve
1 parent c5bbb64 commit 3e24f05

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Flow.Launcher.Infrastructure/QuickSwitch/QuickSwitch.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace Flow.Launcher.Infrastructure.QuickSwitch
1717
{
1818
public static class QuickSwitch
1919
{
20+
private static readonly string ClassName = nameof(QuickSwitch);
21+
2022
private static CUIAutomation8 _automation = new CUIAutomation8Class();
2123

2224
private static InternetExplorer lastExplorerView = null;
@@ -48,7 +50,7 @@ public static bool Initialize()
4850
}
4951
catch (System.Exception e)
5052
{
51-
Log.Exception(nameof(QuickSwitch), "Failed to initialize QuickSwitch", e);
53+
Log.Exception(ClassName, "Failed to initialize QuickSwitch", e);
5254
}
5355

5456
return false;
@@ -128,7 +130,7 @@ private static void WindowSwitch(
128130
uint dwmsEventTime
129131
)
130132
{
131-
IUIAutomationElement window = null;
133+
IUIAutomationElement window;
132134
try
133135
{
134136
window = _automation.ElementFromHandle(hwnd);
@@ -144,7 +146,7 @@ uint dwmsEventTime
144146
return;
145147
}
146148

147-
ShellWindowsClass shellWindows = null;
149+
ShellWindowsClass shellWindows;
148150
try
149151
{
150152
shellWindows = new ShellWindowsClass();
@@ -174,7 +176,7 @@ uint dwmsEventTime
174176
}
175177
catch (System.Exception e)
176178
{
177-
Log.Exception(nameof(QuickSwitch), "Failed to get shell windows", e);
179+
Log.Exception(ClassName, "Failed to get shell windows", e);
178180
}
179181
finally
180182
{

0 commit comments

Comments
 (0)