public NewFilesMonitor(String directoryToMonitor, INewFilesMonitorHandler handler) { this.directoryToMonitor = directoryToMonitor; this.handler = handler; // First make sure the directory exists if (Directory.Exists(directoryToMonitor)) { fwatcher = new FileSystemWatcher(directoryToMonitor); fwatcher.Created += new FileSystemEventHandler(File_Created); } else { Trace.WriteLine(String.Format("Directory doesn't exist: {0}, skipping initialization of file system watcher in newfilesmonitor class.", directoryToMonitor)); } }
public NewFilesMonitor(String directoryToMonitor, INewFilesMonitorHandler handler) { this.directoryToMonitor = directoryToMonitor; this.handler = handler; // First make sure the directory exists if (Directory.Exists(directoryToMonitor)) { fwatcher = new FileSystemWatcher(directoryToMonitor); fwatcher.Created += new FileSystemEventHandler(File_Created); } else { Trace.WriteLine(String.Format("Directory doesn't exist: {0}, skipping initialization of file system watcher in newfilesmonitor class.", directoryToMonitor)); } }