11
11
using System . Threading . Tasks ;
12
12
using System . Windows ;
13
13
using CommunityToolkit . Mvvm . DependencyInjection ;
14
- using Squirrel ;
15
14
using Flow . Launcher . Core ;
16
15
using Flow . Launcher . Core . Plugin ;
16
+ using Flow . Launcher . Core . Resource ;
17
17
using Flow . Launcher . Helper ;
18
18
using Flow . Launcher . Infrastructure ;
19
19
using Flow . Launcher . Infrastructure . Http ;
27
27
using Flow . Launcher . Plugin . SharedCommands ;
28
28
using Flow . Launcher . ViewModel ;
29
29
using JetBrains . Annotations ;
30
- using Flow . Launcher . Core . Resource ;
30
+ using Squirrel ;
31
31
32
32
namespace Flow . Launcher
33
33
{
@@ -78,7 +78,11 @@ public void RestartApp()
78
78
79
79
public bool IsMainWindowVisible ( ) => _mainVM . MainWindowVisibilityStatus ;
80
80
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
+ }
82
86
83
87
// Must use Ioc.Default.GetRequiredService<Updater>() to avoid circular dependency
84
88
public void CheckForNewUpdate ( ) => _ = Ioc . Default . GetRequiredService < Updater > ( ) . UpdateAppAsync ( false ) ;
@@ -162,13 +166,14 @@ public void CopyToClipboard(string stringToCopy, bool directCopy = false, bool s
162
166
public MatchResult FuzzySearch ( string query , string stringToCompare ) =>
163
167
StringMatcher . FuzzySearch ( query , stringToCompare ) ;
164
168
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 ) ;
166
171
167
172
public Task < Stream > HttpGetStreamAsync ( string url , CancellationToken token = default ) =>
168
173
Http . GetStreamAsync ( url , token ) ;
169
174
170
175
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 ) ;
172
177
173
178
public void AddActionKeyword ( string pluginId , string newActionKeyword ) =>
174
179
PluginManager . AddActionKeyword ( pluginId , newActionKeyword ) ;
@@ -190,8 +195,8 @@ public void LogWarn(string className, string message, [CallerMemberName] string
190
195
public void LogError ( string className , string message , [ CallerMemberName ] string methodName = "" ) =>
191
196
Log . Error ( className , message , methodName ) ;
192
197
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 ) ;
195
200
196
201
private readonly ConcurrentDictionary < Type , object > _pluginJsonStorages = new ( ) ;
197
202
@@ -204,7 +209,7 @@ public void RemovePluginSettings(string assemblyName)
204
209
var name = value . GetType ( ) . GetField ( "AssemblyName" ) ? . GetValue ( value ) ? . ToString ( ) ;
205
210
if ( name == assemblyName )
206
211
{
207
- _pluginJsonStorages . Remove ( key , out var pluginJsonStorage ) ;
212
+ _pluginJsonStorages . Remove ( key , out var _ ) ;
208
213
}
209
214
}
210
215
}
@@ -333,17 +338,23 @@ public bool IsGameModeOn()
333
338
334
339
private readonly List < Func < int , int , SpecialKeyState , bool > > _globalKeyboardHandlers = new ( ) ;
335
340
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 ) ;
338
346
339
347
public void ReQuery ( bool reselect = true ) => _mainVM . ReQuery ( reselect ) ;
340
348
341
349
public void BackToQueryResults ( ) => _mainVM . BackToQueryResults ( ) ;
342
350
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 ) =>
344
354
MessageBoxEx . Show ( messageBoxText , caption , button , icon , defaultResult ) ;
345
355
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 ) ;
347
358
348
359
#endregion
349
360
0 commit comments