Search code examples
c#.netfilesystemwatcher

Get Files count from FileSystemWatcher Created event?


I'm wondering if there's a way to get the amount of files that are going to be copied? What I mean is following... I'm writing an app that contains grid, which functions like windows explorer. When I'm drag-droping files, they are copied to a destination folder and my grid is supposed to refresh. My FileSystemWatcher sends me events about created files & grid refreshes, but for multiple files it refreshes multiple times =/ So is there a way to find out how many files were copied, or to get a collection of files just in one event?


Solution

  • I would make the refresh less accurat an let it only refresh again after a defined time. So it could solve this problem for all future refresh Problems and or user refreshes. I also would make the refresh time configurable and every user is happy with it.