12
12
using System . Windows ;
13
13
using System . Windows . Media ;
14
14
using CommunityToolkit . Mvvm . DependencyInjection ;
15
- using Squirrel ;
16
15
using Flow . Launcher . Core ;
17
16
using Flow . Launcher . Core . Plugin ;
18
17
using Flow . Launcher . Core . Resource ;
31
30
using Flow . Launcher . Plugin . SharedCommands ;
32
31
using Flow . Launcher . ViewModel ;
33
32
using JetBrains . Annotations ;
33
+ using Squirrel ;
34
34
35
35
namespace Flow . Launcher
36
36
{
@@ -90,7 +90,11 @@ public async void RestartApp()
90
90
91
91
public bool IsMainWindowVisible ( ) => _mainVM . MainWindowVisibilityStatus ;
92
92
93
- public event VisibilityChangedEventHandler VisibilityChanged { add => _mainVM . VisibilityChanged += value ; remove => _mainVM . VisibilityChanged -= value ; }
93
+ public event VisibilityChangedEventHandler VisibilityChanged
94
+ {
95
+ add => _mainVM . VisibilityChanged += value ;
96
+ remove => _mainVM . VisibilityChanged -= value ;
97
+ }
94
98
95
99
// Must use Ioc.Default.GetRequiredService<Updater>() to avoid circular dependency
96
100
public void CheckForNewUpdate ( ) => _ = Ioc . Default . GetRequiredService < Updater > ( ) . UpdateAppAsync ( false ) ;
@@ -177,13 +181,14 @@ public void CopyToClipboard(string stringToCopy, bool directCopy = false, bool s
177
181
public MatchResult FuzzySearch ( string query , string stringToCompare ) =>
178
182
StringMatcher . FuzzySearch ( query , stringToCompare ) ;
179
183
180
- public Task < string > HttpGetStringAsync ( string url , CancellationToken token = default ) => Http . GetAsync ( url , token ) ;
184
+ public Task < string > HttpGetStringAsync ( string url , CancellationToken token = default ) =>
185
+ Http . GetAsync ( url , token ) ;
181
186
182
187
public Task < Stream > HttpGetStreamAsync ( string url , CancellationToken token = default ) =>
183
188
Http . GetStreamAsync ( url , token ) ;
184
189
185
190
public Task HttpDownloadAsync ( [ NotNull ] string url , [ NotNull ] string filePath , Action < double > reportProgress = null ,
186
- CancellationToken token = default ) => Http . DownloadAsync ( url , filePath , reportProgress , token ) ;
191
+ CancellationToken token = default ) => Http . DownloadAsync ( url , filePath , reportProgress , token ) ;
187
192
188
193
public void AddActionKeyword ( string pluginId , string newActionKeyword ) =>
189
194
PluginManager . AddActionKeyword ( pluginId , newActionKeyword ) ;
@@ -202,8 +207,11 @@ public void LogInfo(string className, string message, [CallerMemberName] string
202
207
public void LogWarn ( string className , string message , [ CallerMemberName ] string methodName = "" ) =>
203
208
Log . Warn ( className , message , methodName ) ;
204
209
205
- public void LogException ( string className , string message , Exception e ,
206
- [ CallerMemberName ] string methodName = "" ) => Log . Exception ( className , message , e , methodName ) ;
210
+ public void LogError ( string className , string message , [ CallerMemberName ] string methodName = "" ) =>
211
+ Log . Error ( className , message , methodName ) ;
212
+
213
+ public void LogException ( string className , string message , Exception e , [ CallerMemberName ] string methodName = "" ) =>
214
+ Log . Exception ( className , message , e , methodName ) ;
207
215
208
216
private readonly ConcurrentDictionary < Type , object > _pluginJsonStorages = new ( ) ;
209
217
@@ -216,7 +224,7 @@ public void RemovePluginSettings(string assemblyName)
216
224
var name = value . GetType ( ) . GetField ( "AssemblyName" ) ? . GetValue ( value ) ? . ToString ( ) ;
217
225
if ( name == assemblyName )
218
226
{
219
- _pluginJsonStorages . TryRemove ( key , out var pluginJsonStorage ) ;
227
+ _pluginJsonStorages . TryRemove ( key , out var _ ) ;
220
228
}
221
229
}
222
230
}
@@ -337,17 +345,23 @@ public bool IsGameModeOn()
337
345
338
346
private readonly List < Func < int , int , SpecialKeyState , bool > > _globalKeyboardHandlers = new ( ) ;
339
347
340
- public void RegisterGlobalKeyboardCallback ( Func < int , int , SpecialKeyState , bool > callback ) => _globalKeyboardHandlers . Add ( callback ) ;
341
- public void RemoveGlobalKeyboardCallback ( Func < int , int , SpecialKeyState , bool > callback ) => _globalKeyboardHandlers . Remove ( callback ) ;
348
+ public void RegisterGlobalKeyboardCallback ( Func < int , int , SpecialKeyState , bool > callback ) =>
349
+ _globalKeyboardHandlers . Add ( callback ) ;
350
+
351
+ public void RemoveGlobalKeyboardCallback ( Func < int , int , SpecialKeyState , bool > callback ) =>
352
+ _globalKeyboardHandlers . Remove ( callback ) ;
342
353
343
354
public void ReQuery ( bool reselect = true ) => _mainVM . ReQuery ( reselect ) ;
344
355
345
356
public void BackToQueryResults ( ) => _mainVM . BackToQueryResults ( ) ;
346
357
347
- public MessageBoxResult ShowMsgBox ( string messageBoxText , string caption = "" , MessageBoxButton button = MessageBoxButton . OK , MessageBoxImage icon = MessageBoxImage . None , MessageBoxResult defaultResult = MessageBoxResult . OK ) =>
358
+ public MessageBoxResult ShowMsgBox ( string messageBoxText , string caption = "" ,
359
+ MessageBoxButton button = MessageBoxButton . OK , MessageBoxImage icon = MessageBoxImage . None ,
360
+ MessageBoxResult defaultResult = MessageBoxResult . OK ) =>
348
361
MessageBoxEx . Show ( messageBoxText , caption , button , icon , defaultResult ) ;
349
362
350
- public Task ShowProgressBoxAsync ( string caption , Func < Action < double > , Task > reportProgressAsync , Action cancelProgress = null ) => ProgressBoxEx . ShowAsync ( caption , reportProgressAsync , cancelProgress ) ;
363
+ public Task ShowProgressBoxAsync ( string caption , Func < Action < double > , Task > reportProgressAsync ,
364
+ Action cancelProgress = null ) => ProgressBoxEx . ShowAsync ( caption , reportProgressAsync , cancelProgress ) ;
351
365
352
366
private readonly ConcurrentDictionary < ( string , string , Type ) , object > _pluginBinaryStorages = new ( ) ;
353
367
0 commit comments