void IChangeSetHandler.Handle(ChangeSet changes)
        {
            // File system changes are too fast in OSX world.
            if (!Platform.IsWindows)
            {
                Thread.Sleep(500);
            }

            _connector.SendMessageToClient(new RefreshPage());
        }
        void IChangeSetHandler.Handle(ChangeSet changes)
        {
            if (changes.Added.Concat(changes.Changed).Any(x => FileChangeShouldRegenerateTopicTree(x.Path)) ||
                changes.Deleted.Any())
            {
                _project.ReadTopics();
                _refresher.RefreshPage();
            }
            else
            {
                _refresher.RefreshPage();
            }


        }
Beispiel #3
0
        public ChangeSet DetectChanges(IEnumerable<IFileReference> files)
        {
            var changeSet = new ChangeSet();

            var dict = files.ToDictionary(x => x.RelativePath);
            var deleted = _files.Keys.Where(x => !dict.ContainsKey(x));
            changeSet.Deleted.AddRange(deleted);

            
            changeSet.Added.AddRange(files.Where(x => !_files.ContainsKey(x.RelativePath)));


            var changed = files.Where(x => _files.ContainsKey(x.RelativePath) && _files[x.RelativePath] != x.ExactLastWriteTime());
            changeSet.Changed.AddRange(changed);

            return changeSet;

        }
        public void Handle(ChangeSet changes)
        {
            changes.Changed.Each(x =>
            {
                if (!_latched) _observer.Changed(x.Path);
            });

            changes.Deleted.Each(x =>
            {
                if (!_latched) _observer.Deleted(x);
            });


            changes.Added.Each(x =>
            {
                if (!_latched) _observer.Added(x.Path);
            });
        }
 public void Handle(ChangeSet changes)
 {
     changes.Changed.Each(x => _observer.Changed(x.Path));
     changes.Deleted.Each(x => _observer.Deleted(x));
     changes.Added.Each(x => _observer.Added(x.Path));
 }
 void IChangeSetHandler.Handle(ChangeSet changes)
 {
     Console.WriteLine("Detected binary file changes at {0}: {1}", _watcher.Root, changes);
     _callback();
 }
            public void Handle(ChangeSet changes)
            {
                var added = _parent.readFiles(changes.Added.Select(x => _root.AppendPath(x.RelativePath)));
                var modified = _parent.readFiles(changes.Changed.Select(x => _root.AppendPath(x.RelativePath)));

                Task.WhenAll(added, modified).ContinueWith(t => _parent._browser.RefreshPage());
            }