예제 #1
0
        private void gatherChanges()
        {
            var enumerator = new FileSystemChangeEnumerator(
                this.Filter,
                this.RootDir,
                this.EnumerationOptions,
                this);

            enumerator.Scan();
        }
        // This function walks all watched files, collects changes, and updates state
        public FileChangeList GetChanges()
        {
            _version++;

            var enumerator = new FileSystemChangeEnumerator(this);

            while (enumerator.MoveNext())
            {
                // Ignore `.Current`
            }
            var changes = enumerator.Changes;

            List <(string directory, string path)> removals = GetRemovals();

            foreach (var(directory, path) in removals)
            {
                changes.AddRemoved(directory, path);
                _state.Remove(directory, path);
            }

            return(changes);
        }