public FileStatusEvent(string directory)
        {
            _dirMonitor = new DirMonitoring(directory);

            if (_dirMonitor.StartMonitor())
            {
                _timer          = new Timer(1000);
                _timer.Elapsed += CheckRemoval;
                _timer.Start();
            }
            else
            {
                Console.WriteLine("Specified directory does not exist");
                Dispose();
            }
        }
예제 #2
0
        public FileStatusDelegate(string directory, Action <string> subscriber)
        {
            _subscriber = subscriber;
            _dirMonitor = new DirMonitoring(directory);

            if (_dirMonitor.StartMonitor())
            {
                _timer          = new Timer(1000);
                _timer.Elapsed += CheckRemoval;
                _timer.Start();
            }
            else
            {
                Console.WriteLine("Specified directory does not exist");
                Dispose();
            }
        }