fileSystemWatcher
I'm using fileSystemWatcher to check when a file is edited but every time I edit a file it opens ScanResult window more than 7 times
Code:
2 Replies
I am not sure but I would guess the file is being written and then metadata is being updated, unless your event handler is being registered more than once. If you're able to put a breakpoint on the event registration you could look into that one pretty easily.
Otherwise I'd probably use some kind of timeout (
if (_lastScanResult < DateTime.Now.AddSeconds(-5)) { _lastScanResult = DateTime.Now; ... }
).ok