示例#1
0
            private bool IncludeChange(PathChangeEntry entry)
            {
                // Ignore changes for files that have been created then deleted
                if (entry.ChangeKind == PathChangeKind.None)
                {
                    return(false);
                }

                return(true);
            }
示例#2
0
            private void EnqueueChangeEvent(FullPath rootPath, RelativePath entryPath, PathChangeKind changeKind, PathKind pathKind)
            {
                //Logger.LogInfo("Enqueue change event: {0}, {1}", path, changeKind);
                var entry = new PathChangeEntry(rootPath, entryPath, changeKind, pathKind);

                GlobalChangeRecorder.RecordChange(new PathChangeRecorder.ChangeInfo {
                    Entry        = entry,
                    TimeStampUtc = DateTimeProvider.UtcNow,
                });

                MergePathChange(_enqueuedChangedPaths, entry);
            }
示例#3
0
        private static void MergePathChange(IDictionary <FullPath, PathChangeEntry> changes, PathChangeEntry entry)
        {
            var             currentChangeKind = PathChangeKind.None;
            var             currentPathKind   = PathKind.FileOrDirectory;
            PathChangeEntry currentEntry;

            if (changes.TryGetValue(entry.Path, out currentEntry))
            {
                currentChangeKind = currentEntry.ChangeKind;
                currentPathKind   = currentEntry.PathKind;
            }
            changes[entry.Path] = new PathChangeEntry(
                entry.BasePath,
                entry.RelativePath,
                CombineChangeKinds(currentChangeKind, entry.ChangeKind),
                CombinePathKind(currentPathKind, entry.PathKind));
        }
        private bool IncludeChange(PathChangeEntry change)
        {
            var path = change.Path;
              var changeType = change.Kind;

              // Ignore changes for files that have been created then deleted
              if (changeType == PathChangeKind.None)
            return false;

              // Creation/changes to a directory entry are irrelevant (we will get notifications
              // for files inside the directory is anything relevant occured.)
              if (_fileSystem.DirectoryExists(path)) {
            if (changeType == PathChangeKind.Changed || changeType == PathChangeKind.Created)
              return false;
              }

              return true;
        }