Пример #1
0
        public void Run(IFileHandler fileHandler)
        {
            try
            {
                WatcherMapping.AddEventHandlers(FileSystemWatcher, fileHandler);

                FileSystemWatcher.EnableRaisingEvents = true;
            }
            catch (ArgumentNullException)
            {
                Logger.WriteLine("Set Path to Directory to Track in AppConfig file.");
            }
            catch (Exception)
            {
                Logger.WriteLine("AN ERROR HAS OCCURRED! Check AppConfig file.");
            }
        }
Пример #2
0
        public void Stop(IFileHandler fileHandler)
        {
            WatcherMapping.RemoveEventHandlers(FileSystemWatcher, fileHandler);

            FileSystemWatcher.EnableRaisingEvents = false;
        }