I have this code to create multiple filesystemwatch ers and store them in an array list but I need to be able to reference an individual watcher to disable raising events while I complete another process. Does anyone know how to achieve this?.
Thanks
Thanks
Code:
protected void CreateWatchers()
{
Logtext("Create Watchers");
foreach (string s in watchers)
{
System.IO.FileSystemWatcher Clientwatcher = new System.IO.FileSystemWatcher();
Clientwatcher.Path = s;
Clientwatcher.Filter = "*.FIDEF";
//Clientwatcher.NotifyFilter = NotifyFilters.
Clientwatcher.IncludeSubdirectories = false;
Clientwatcher.Created += new FileSystemEventHandler(FileWatcherUpdated);
//Clientwatcher.Changed += new FileSystemEventHandler(FileWatcherUpdated);
Clientwatcher.EnableRaisingEvents = true;
fw.Add(Clientwatcher);
}
Comment