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