コード例 #1
0
ファイル: FileObserver.cs プロジェクト: sujithq/AkkaMjrOne
        /// <summary>
        /// Begin monitoring file.
        /// </summary>
        public void Start()
        {
            // Need this for Mono 3.12.0 workaround
            // uncomment this line if you're running on Mono!
            Environment.SetEnvironmentVariable("MONO_MANAGED_WATCHER", "enabled");

            // make watcher to observe our specific file
            _watcher = new PollingFileSystemWatcher(_fileDir, "*" + _fileExtension);

            // assign callbacks for event types
            _watcher.ChangedDetailed += OnFileChanged;
            _watcher.Error           += OnFileError;

            // start watching
            _watcher.Start();
        }
コード例 #2
0
 internal FileSystemChangeEnumerator(PollingFileSystemWatcher watcher, string directory, EnumerationOptions options = null)
     : base(directory, options)
 {
     _watcher = watcher;
 }