Esempio n. 1
0
        public DirWatcher(string path, LogWriter logWriter)
        {
            _logWriter = logWriter;

            _myFolderWatcher                     = new FileSystemSafeWatcher(path);
            _myFolderWatcher.Created            += MyWatcher_Created;
            _myFolderWatcher.Deleted            += MyWatcher_Deleted;
            _myFolderWatcher.EnableRaisingEvents = true;
        }
        public FileMonitoringObject(string folder, LogWriter logWriter, string observationPattern)
        {
            _logWriter          = logWriter;
            _fileSystemWatcher  = new FileSystemSafeWatcher(folder);
            _observationPattern = observationPattern;

            _fileSystemWatcher.Changed            += MyWatcher_Changed;
            _fileSystemWatcher.Created            += MyWatcher_Created;
            _fileSystemWatcher.Deleted            += MyWatcher_Deleted;
            _fileSystemWatcher.EnableRaisingEvents = true;
        }