@@ -328,37 +328,36 @@ public void AppendLink(string containerName, AccessLink link)
328
328
container . Add ( link ) ;
329
329
}
330
330
331
-
332
331
[ RelayCommand ]
333
- private void EditIndexSearchExcludePaths ( object commandParameter )
332
+ private void EditIndexSearchExcludePaths ( )
334
333
{
335
-
334
+ var selectedLink = SelectedIndexSearchExcludedPath ;
336
335
var collection = Settings . IndexSearchExcludedSubdirectoryPaths ;
337
336
338
- if ( SelectedIndexSearchExcludedPath is null )
337
+ if ( selectedLink is null )
339
338
{
340
339
ShowUnselectedMessage ( ) ;
341
340
return ;
342
341
}
343
342
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 ) ) ;
348
347
349
348
if ( path is null )
350
349
return ;
351
350
352
- var selectedType = SelectedIndexSearchExcludedPath . Type ;
353
- collection . Remove ( SelectedIndexSearchExcludedPath ) ;
351
+ var selectedType = selectedLink . Type ;
352
+ collection . Remove ( selectedLink ) ;
354
353
collection . Add ( new AccessLink
355
354
{
356
355
Path = path , Type = selectedType , Name = path . GetPathName ( )
357
356
} ) ;
358
357
}
359
358
360
359
[ RelayCommand ]
361
- private void AddIndexSearchExcludePaths ( object commandParameter )
360
+ private void AddIndexSearchExcludePaths ( )
362
361
{
363
362
var container = Settings . IndexSearchExcludedSubdirectoryPaths ;
364
363
@@ -378,30 +377,37 @@ private void AddIndexSearchExcludePaths(object commandParameter)
378
377
}
379
378
380
379
[ RelayCommand ]
381
- private void EditQuickAccessLink ( object commandParameter )
380
+ private void EditQuickAccessLink ( )
382
381
{
383
- if ( SelectedQuickAccessLink is null )
382
+ var selectedLink = SelectedQuickAccessLink ;
383
+ var collection = Settings . QuickAccessLinks ;
384
+
385
+ if ( selectedLink is null )
384
386
{
385
387
ShowUnselectedMessage ( ) ;
386
388
return ;
387
389
}
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
+ }
390
395
}
391
396
392
397
[ RelayCommand ]
393
- private void AddQuickAccessLink ( object commandParameter )
398
+ private void AddQuickAccessLink ( )
394
399
{
395
400
var quickAccessLinkSettings = new QuickAccessLinkSettings ( Settings . QuickAccessLinks ) ;
396
- if ( quickAccessLinkSettings . ShowDialog ( ) == true ) Save ( ) ;
401
+ if ( quickAccessLinkSettings . ShowDialog ( ) == true )
402
+ {
403
+ Save ( ) ;
404
+ }
397
405
}
398
-
399
-
400
406
401
407
[ RelayCommand ]
402
- private void RemoveLink ( object obj )
408
+ private void RemoveLink ( object commandParameter )
403
409
{
404
- if ( obj is not string container ) return ;
410
+ if ( commandParameter is not string container ) return ;
405
411
406
412
switch ( container )
407
413
{
0 commit comments