I have a listview that I populate with file names from a folder that is being watched (using FileSystemWatcher via "AddHandler FileWatch.Created, AddressOf FileWatchNewFile"). When a new file is created in the folder, it is added to the listview from the FileWatchNewFile function.
Processing each file could take up to a minute or two, so the listview could contain dozens of entries that are waiting to be processed. Once a file is processed, it is flagged/removed. It's possible that all the files could be processed so that the listview becomes empty.
My question is this: What is the best way to watch the listview in order to process the entries (filenames) as they show up?
Should I use a timer that would fire every 10 seconds to see if the file processing code is waiting to be called? What if the file processing code is still processing a file?
Hopefully you get the idea.
tia
flynn
Processing each file could take up to a minute or two, so the listview could contain dozens of entries that are waiting to be processed. Once a file is processed, it is flagged/removed. It's possible that all the files could be processed so that the listview becomes empty.
My question is this: What is the best way to watch the listview in order to process the entries (filenames) as they show up?
Should I use a timer that would fire every 10 seconds to see if the file processing code is waiting to be called? What if the file processing code is still processing a file?
Hopefully you get the idea.
tia
flynn