Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
        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));
            }
        }