mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-11 17:59:17 +00:00
Run code cleanup
This commit is contained in:
@@ -62,6 +62,6 @@ internal class FocusMonitor
|
||||
|
||||
internal static FocusMonitor GetInstance()
|
||||
{
|
||||
return _instance ?? (_instance = new FocusMonitor());
|
||||
return _instance ??= new FocusMonitor();
|
||||
}
|
||||
}
|
||||
|
@@ -43,11 +43,11 @@ internal class KeystrokeDispatcher : IDisposable
|
||||
{
|
||||
InstallKeyHook(KeyDownEventHandler, KeyUpEventHandler);
|
||||
|
||||
_validKeys = new HashSet<Keys>(
|
||||
_validKeys =
|
||||
[
|
||||
Keys.Up, Keys.Down, Keys.Left, Keys.Right,
|
||||
Keys.Enter, Keys.Space, Keys.Escape
|
||||
]);
|
||||
];
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
@@ -83,7 +83,7 @@ internal static class QuickLook
|
||||
|
||||
internal static string GetCurrentSelection()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(MaxPath);
|
||||
StringBuilder sb = new(MaxPath);
|
||||
// communicate with COM in a separate STA thread
|
||||
var thread = new Thread(() =>
|
||||
{
|
||||
@@ -107,7 +107,7 @@ internal static class QuickLook
|
||||
// We got a quoted string which breaks ResolveShortcut
|
||||
sb = sb.Replace("\"", string.Empty, 0, 1).Replace("\"", string.Empty, sb.Length - 1, 1);
|
||||
}
|
||||
return ResolveShortcut(sb?.ToString() ?? String.Empty);
|
||||
return ResolveShortcut(sb?.ToString() ?? string.Empty);
|
||||
}
|
||||
|
||||
private static string ResolveShortcut(string path)
|
||||
|
Reference in New Issue
Block a user