File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
src/Files.App/Utils/RecycleBin Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -51,18 +51,21 @@ private void StartRecycleBinWatcher()
51
51
if ( drive . DriveType == SystemIO . DriveType . Network || ! SystemIO . Directory . Exists ( recyclePath ) )
52
52
continue ;
53
53
54
- SystemIO . FileSystemWatcher watcher = new ( )
54
+ SafetyExtensions . IgnoreExceptions ( ( ) =>
55
55
{
56
- Path = recyclePath ,
57
- Filter = "*.*" ,
58
- NotifyFilter = SystemIO . NotifyFilters . LastWrite | SystemIO . NotifyFilters . FileName | SystemIO . NotifyFilters . DirectoryName
59
- } ;
60
-
61
- watcher . Created += RecycleBinWatcher_Changed ;
62
- watcher . Deleted += RecycleBinWatcher_Changed ;
63
- watcher . EnableRaisingEvents = true ;
64
-
65
- binWatchers . Add ( watcher ) ;
56
+ SystemIO . FileSystemWatcher watcher = new ( )
57
+ {
58
+ Path = recyclePath ,
59
+ Filter = "*.*" ,
60
+ NotifyFilter = SystemIO . NotifyFilters . LastWrite | SystemIO . NotifyFilters . FileName | SystemIO . NotifyFilters . DirectoryName
61
+ } ;
62
+
63
+ watcher . Created += RecycleBinWatcher_Changed ;
64
+ watcher . Deleted += RecycleBinWatcher_Changed ;
65
+ watcher . EnableRaisingEvents = true ;
66
+
67
+ binWatchers . Add ( watcher ) ;
68
+ } ) ;
66
69
}
67
70
}
68
71
You can’t perform that action at this time.
0 commit comments