@@ -328,37 +328,36 @@ public void AppendLink(string containerName, AccessLink link)
328328 container . Add ( link ) ;
329329 }
330330
331-
332331 [ RelayCommand ]
333- private void EditIndexSearchExcludePaths ( object commandParameter )
332+ private void EditIndexSearchExcludePaths ( )
334333 {
335-
334+ var selectedLink = SelectedIndexSearchExcludedPath ;
336335 var collection = Settings . IndexSearchExcludedSubdirectoryPaths ;
337336
338- if ( SelectedIndexSearchExcludedPath is null )
337+ if ( selectedLink is null )
339338 {
340339 ShowUnselectedMessage ( ) ;
341340 return ;
342341 }
343342
344- var path = PromptUserSelectPath ( SelectedIndexSearchExcludedPath . Type ,
345- SelectedIndexSearchExcludedPath . Type == ResultType . Folder
346- ? SelectedIndexSearchExcludedPath . Path
347- : Path . GetDirectoryName ( SelectedIndexSearchExcludedPath . Path ) ) ;
343+ var path = PromptUserSelectPath ( selectedLink . Type ,
344+ selectedLink . Type == ResultType . Folder
345+ ? selectedLink . Path
346+ : Path . GetDirectoryName ( selectedLink . Path ) ) ;
348347
349348 if ( path is null )
350349 return ;
351350
352- var selectedType = SelectedIndexSearchExcludedPath . Type ;
353- collection . Remove ( SelectedIndexSearchExcludedPath ) ;
351+ var selectedType = selectedLink . Type ;
352+ collection . Remove ( selectedLink ) ;
354353 collection . Add ( new AccessLink
355354 {
356355 Path = path , Type = selectedType , Name = path . GetPathName ( )
357356 } ) ;
358357 }
359358
360359 [ RelayCommand ]
361- private void AddIndexSearchExcludePaths ( object commandParameter )
360+ private void AddIndexSearchExcludePaths ( )
362361 {
363362 var container = Settings . IndexSearchExcludedSubdirectoryPaths ;
364363
@@ -378,30 +377,37 @@ private void AddIndexSearchExcludePaths(object commandParameter)
378377 }
379378
380379 [ RelayCommand ]
381- private void EditQuickAccessLink ( object commandParameter )
380+ private void EditQuickAccessLink ( )
382381 {
383- if ( SelectedQuickAccessLink is null )
382+ var selectedLink = SelectedQuickAccessLink ;
383+ var collection = Settings . QuickAccessLinks ;
384+
385+ if ( selectedLink is null )
384386 {
385387 ShowUnselectedMessage ( ) ;
386388 return ;
387389 }
388- var quickAccessLinkSettings = new QuickAccessLinkSettings ( Settings . QuickAccessLinks , SelectedQuickAccessLink ) ;
389- if ( quickAccessLinkSettings . ShowDialog ( ) == true ) Save ( ) ;
390+ var quickAccessLinkSettings = new QuickAccessLinkSettings ( collection , SelectedQuickAccessLink ) ;
391+ if ( quickAccessLinkSettings . ShowDialog ( ) == true )
392+ {
393+ Save ( ) ;
394+ }
390395 }
391396
392397 [ RelayCommand ]
393- private void AddQuickAccessLink ( object commandParameter )
398+ private void AddQuickAccessLink ( )
394399 {
395400 var quickAccessLinkSettings = new QuickAccessLinkSettings ( Settings . QuickAccessLinks ) ;
396- if ( quickAccessLinkSettings . ShowDialog ( ) == true ) Save ( ) ;
401+ if ( quickAccessLinkSettings . ShowDialog ( ) == true )
402+ {
403+ Save ( ) ;
404+ }
397405 }
398-
399-
400406
401407 [ RelayCommand ]
402- private void RemoveLink ( object obj )
408+ private void RemoveLink ( object commandParameter )
403409 {
404- if ( obj is not string container ) return ;
410+ if ( commandParameter is not string container ) return ;
405411
406412 switch ( container )
407413 {
0 commit comments