Skip to content

Commit 1381248

Browse files
committed
Adjust code formats
1 parent 6f0126d commit 1381248

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
using System.Threading.Tasks;
1212
using System.Windows;
1313
using CommunityToolkit.Mvvm.DependencyInjection;
14-
using Squirrel;
1514
using Flow.Launcher.Core;
1615
using Flow.Launcher.Core.Plugin;
16+
using Flow.Launcher.Core.Resource;
1717
using Flow.Launcher.Helper;
1818
using Flow.Launcher.Infrastructure;
1919
using Flow.Launcher.Infrastructure.Http;
@@ -27,7 +27,7 @@
2727
using Flow.Launcher.Plugin.SharedCommands;
2828
using Flow.Launcher.ViewModel;
2929
using JetBrains.Annotations;
30-
using Flow.Launcher.Core.Resource;
30+
using Squirrel;
3131

3232
namespace Flow.Launcher
3333
{
@@ -78,7 +78,11 @@ public void RestartApp()
7878

7979
public bool IsMainWindowVisible() => _mainVM.MainWindowVisibilityStatus;
8080

81-
public event VisibilityChangedEventHandler VisibilityChanged { add => _mainVM.VisibilityChanged += value; remove => _mainVM.VisibilityChanged -= value; }
81+
public event VisibilityChangedEventHandler VisibilityChanged
82+
{
83+
add => _mainVM.VisibilityChanged += value;
84+
remove => _mainVM.VisibilityChanged -= value;
85+
}
8286

8387
// Must use Ioc.Default.GetRequiredService<Updater>() to avoid circular dependency
8488
public void CheckForNewUpdate() => _ = Ioc.Default.GetRequiredService<Updater>().UpdateAppAsync(false);
@@ -162,13 +166,14 @@ public void CopyToClipboard(string stringToCopy, bool directCopy = false, bool s
162166
public MatchResult FuzzySearch(string query, string stringToCompare) =>
163167
StringMatcher.FuzzySearch(query, stringToCompare);
164168

165-
public Task<string> HttpGetStringAsync(string url, CancellationToken token = default) => Http.GetAsync(url, token);
169+
public Task<string> HttpGetStringAsync(string url, CancellationToken token = default) =>
170+
Http.GetAsync(url, token);
166171

167172
public Task<Stream> HttpGetStreamAsync(string url, CancellationToken token = default) =>
168173
Http.GetStreamAsync(url, token);
169174

170175
public Task HttpDownloadAsync([NotNull] string url, [NotNull] string filePath, Action<double> reportProgress = null,
171-
CancellationToken token = default) => Http.DownloadAsync(url, filePath, reportProgress, token);
176+
CancellationToken token = default) =>Http.DownloadAsync(url, filePath, reportProgress, token);
172177

173178
public void AddActionKeyword(string pluginId, string newActionKeyword) =>
174179
PluginManager.AddActionKeyword(pluginId, newActionKeyword);
@@ -190,8 +195,8 @@ public void LogWarn(string className, string message, [CallerMemberName] string
190195
public void LogError(string className, string message, [CallerMemberName] string methodName = "") =>
191196
Log.Error(className, message, methodName);
192197

193-
public void LogException(string className, string message, Exception e,
194-
[CallerMemberName] string methodName = "") => Log.Exception(className, message, e, methodName);
198+
public void LogException(string className, string message, Exception e, [CallerMemberName] string methodName = "") =>
199+
Log.Exception(className, message, e, methodName);
195200

196201
private readonly ConcurrentDictionary<Type, object> _pluginJsonStorages = new();
197202

@@ -204,7 +209,7 @@ public void RemovePluginSettings(string assemblyName)
204209
var name = value.GetType().GetField("AssemblyName")?.GetValue(value)?.ToString();
205210
if (name == assemblyName)
206211
{
207-
_pluginJsonStorages.Remove(key, out var pluginJsonStorage);
212+
_pluginJsonStorages.Remove(key, out var _);
208213
}
209214
}
210215
}
@@ -333,17 +338,23 @@ public bool IsGameModeOn()
333338

334339
private readonly List<Func<int, int, SpecialKeyState, bool>> _globalKeyboardHandlers = new();
335340

336-
public void RegisterGlobalKeyboardCallback(Func<int, int, SpecialKeyState, bool> callback) => _globalKeyboardHandlers.Add(callback);
337-
public void RemoveGlobalKeyboardCallback(Func<int, int, SpecialKeyState, bool> callback) => _globalKeyboardHandlers.Remove(callback);
341+
public void RegisterGlobalKeyboardCallback(Func<int, int, SpecialKeyState, bool> callback) =>
342+
_globalKeyboardHandlers.Add(callback);
343+
344+
public void RemoveGlobalKeyboardCallback(Func<int, int, SpecialKeyState, bool> callback) =>
345+
_globalKeyboardHandlers.Remove(callback);
338346

339347
public void ReQuery(bool reselect = true) => _mainVM.ReQuery(reselect);
340348

341349
public void BackToQueryResults() => _mainVM.BackToQueryResults();
342350

343-
public MessageBoxResult ShowMsgBox(string messageBoxText, string caption = "", MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.OK) =>
351+
public MessageBoxResult ShowMsgBox(string messageBoxText, string caption = "",
352+
MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None,
353+
MessageBoxResult defaultResult = MessageBoxResult.OK) =>
344354
MessageBoxEx.Show(messageBoxText, caption, button, icon, defaultResult);
345355

346-
public Task ShowProgressBoxAsync(string caption, Func<Action<double>, Task> reportProgressAsync, Action cancelProgress = null) => ProgressBoxEx.ShowAsync(caption, reportProgressAsync, cancelProgress);
356+
public Task ShowProgressBoxAsync(string caption, Func<Action<double>, Task> reportProgressAsync,
357+
Action cancelProgress = null) => ProgressBoxEx.ShowAsync(caption, reportProgressAsync, cancelProgress);
347358

348359
#endregion
349360

0 commit comments

Comments
 (0)