1212using System . Windows ;
1313using System . Windows . Media ;
1414using CommunityToolkit . Mvvm . DependencyInjection ;
15- using Squirrel ;
1615using Flow . Launcher . Core ;
1716using Flow . Launcher . Core . Plugin ;
17+ using Flow . Launcher . Core . Resource ;
18+ using Flow . Launcher . Core . ExternalPlugins ;
1819using Flow . Launcher . Helper ;
1920using Flow . Launcher . Infrastructure ;
2021using Flow . Launcher . Infrastructure . Http ;
2829using Flow . Launcher . Plugin . SharedCommands ;
2930using Flow . Launcher . ViewModel ;
3031using JetBrains . Annotations ;
31- using Flow . Launcher . Core . Resource ;
32- using Flow . Launcher . Core . ExternalPlugins ;
32+ using Squirrel ;
3333
3434namespace Flow . Launcher
3535{
@@ -92,7 +92,11 @@ public async void RestartApp()
9292
9393 public bool IsMainWindowVisible ( ) => _mainVM . MainWindowVisibilityStatus ;
9494
95- public event VisibilityChangedEventHandler VisibilityChanged { add => _mainVM . VisibilityChanged += value ; remove => _mainVM . VisibilityChanged -= value ; }
95+ public event VisibilityChangedEventHandler VisibilityChanged
96+ {
97+ add => _mainVM . VisibilityChanged += value ;
98+ remove => _mainVM . VisibilityChanged -= value ;
99+ }
96100
97101 // Must use Ioc.Default.GetRequiredService<Updater>() to avoid circular dependency
98102 public void CheckForNewUpdate ( ) => _ = Ioc . Default . GetRequiredService < Updater > ( ) . UpdateAppAsync ( false ) ;
@@ -179,13 +183,14 @@ public void CopyToClipboard(string stringToCopy, bool directCopy = false, bool s
179183 public MatchResult FuzzySearch ( string query , string stringToCompare ) =>
180184 StringMatcher . FuzzySearch ( query , stringToCompare ) ;
181185
182- public Task < string > HttpGetStringAsync ( string url , CancellationToken token = default ) => Http . GetAsync ( url , token ) ;
186+ public Task < string > HttpGetStringAsync ( string url , CancellationToken token = default ) =>
187+ Http . GetAsync ( url , token ) ;
183188
184189 public Task < Stream > HttpGetStreamAsync ( string url , CancellationToken token = default ) =>
185190 Http . GetStreamAsync ( url , token ) ;
186191
187192 public Task HttpDownloadAsync ( [ NotNull ] string url , [ NotNull ] string filePath , Action < double > reportProgress = null ,
188- CancellationToken token = default ) => Http . DownloadAsync ( url , filePath , reportProgress , token ) ;
193+ CancellationToken token = default ) => Http . DownloadAsync ( url , filePath , reportProgress , token ) ;
189194
190195 public void AddActionKeyword ( string pluginId , string newActionKeyword ) =>
191196 PluginManager . AddActionKeyword ( pluginId , newActionKeyword ) ;
@@ -204,8 +209,11 @@ public void LogInfo(string className, string message, [CallerMemberName] string
204209 public void LogWarn ( string className , string message , [ CallerMemberName ] string methodName = "" ) =>
205210 Log . Warn ( className , message , methodName ) ;
206211
207- public void LogException ( string className , string message , Exception e ,
208- [ CallerMemberName ] string methodName = "" ) => Log . Exception ( className , message , e , methodName ) ;
212+ public void LogError ( string className , string message , [ CallerMemberName ] string methodName = "" ) =>
213+ Log . Error ( className , message , methodName ) ;
214+
215+ public void LogException ( string className , string message , Exception e , [ CallerMemberName ] string methodName = "" ) =>
216+ Log . Exception ( className , message , e , methodName ) ;
209217
210218 private readonly ConcurrentDictionary < Type , object > _pluginJsonStorages = new ( ) ;
211219
@@ -218,7 +226,7 @@ public void RemovePluginSettings(string assemblyName)
218226 var name = value . GetType ( ) . GetField ( "AssemblyName" ) ? . GetValue ( value ) ? . ToString ( ) ;
219227 if ( name == assemblyName )
220228 {
221- _pluginJsonStorages . Remove ( key , out var pluginJsonStorage ) ;
229+ _pluginJsonStorages . Remove ( key , out var _ ) ;
222230 }
223231 }
224232 }
@@ -347,17 +355,23 @@ public bool IsGameModeOn()
347355
348356 private readonly List < Func < int , int , SpecialKeyState , bool > > _globalKeyboardHandlers = new ( ) ;
349357
350- public void RegisterGlobalKeyboardCallback ( Func < int , int , SpecialKeyState , bool > callback ) => _globalKeyboardHandlers . Add ( callback ) ;
351- public void RemoveGlobalKeyboardCallback ( Func < int , int , SpecialKeyState , bool > callback ) => _globalKeyboardHandlers . Remove ( callback ) ;
358+ public void RegisterGlobalKeyboardCallback ( Func < int , int , SpecialKeyState , bool > callback ) =>
359+ _globalKeyboardHandlers . Add ( callback ) ;
360+
361+ public void RemoveGlobalKeyboardCallback ( Func < int , int , SpecialKeyState , bool > callback ) =>
362+ _globalKeyboardHandlers . Remove ( callback ) ;
352363
353364 public void ReQuery ( bool reselect = true ) => _mainVM . ReQuery ( reselect ) ;
354365
355366 public void BackToQueryResults ( ) => _mainVM . BackToQueryResults ( ) ;
356367
357- public MessageBoxResult ShowMsgBox ( string messageBoxText , string caption = "" , MessageBoxButton button = MessageBoxButton . OK , MessageBoxImage icon = MessageBoxImage . None , MessageBoxResult defaultResult = MessageBoxResult . OK ) =>
368+ public MessageBoxResult ShowMsgBox ( string messageBoxText , string caption = "" ,
369+ MessageBoxButton button = MessageBoxButton . OK , MessageBoxImage icon = MessageBoxImage . None ,
370+ MessageBoxResult defaultResult = MessageBoxResult . OK ) =>
358371 MessageBoxEx . Show ( messageBoxText , caption , button , icon , defaultResult ) ;
359372
360- public Task ShowProgressBoxAsync ( string caption , Func < Action < double > , Task > reportProgressAsync , Action cancelProgress = null ) => ProgressBoxEx . ShowAsync ( caption , reportProgressAsync , cancelProgress ) ;
373+ public Task ShowProgressBoxAsync ( string caption , Func < Action < double > , Task > reportProgressAsync ,
374+ Action cancelProgress = null ) => ProgressBoxEx . ShowAsync ( caption , reportProgressAsync , cancelProgress ) ;
361375
362376 public List < ThemeData > GetAvailableThemes ( ) => Theme . GetAvailableThemes ( ) ;
363377
0 commit comments