@@ -249,7 +249,7 @@ void IterateAndModifyFilesData (DefaultWatcherData data, string directory, bool
249249 }
250250
251251 if ( dispatch )
252- DispatchEvents ( data . FSW , FileAction . Added , filename ) ;
252+ DispatchEvents ( data . FSW , FileAction . Added , Path . GetRelativePath ( directory , filename ) ) ;
253253 } else if ( fd . Directory == directory ) {
254254 fd . NotExists = false ;
255255 }
@@ -268,7 +268,7 @@ void IterateAndModifyFilesData (DefaultWatcherData data, string directory, bool
268268 removed = new List < string > ( ) ;
269269
270270 removed . Add ( filename ) ;
271- DispatchEvents ( data . FSW , FileAction . Removed , filename ) ;
271+ DispatchEvents ( data . FSW , FileAction . Removed , Path . GetRelativePath ( fd . Directory , filename ) ) ;
272272 }
273273 }
274274
@@ -293,14 +293,14 @@ void IterateAndModifyFilesData (DefaultWatcherData data, string directory, bool
293293 removed = new List < string > ( ) ;
294294
295295 removed . Add ( filename ) ;
296- DispatchEvents ( data . FSW , FileAction . Removed , filename ) ;
296+ DispatchEvents ( data . FSW , FileAction . Removed , Path . GetRelativePath ( fd . Directory , filename ) ) ;
297297 continue ;
298298 }
299299
300300 if ( creation != fd . CreationTime || write != fd . LastWriteTime ) {
301301 fd . CreationTime = creation ;
302302 fd . LastWriteTime = write ;
303- DispatchEvents ( data . FSW , FileAction . Modified , filename ) ;
303+ DispatchEvents ( data . FSW , FileAction . Modified , Path . GetRelativePath ( fd . Directory , filename ) ) ;
304304 }
305305 }
306306
0 commit comments