コード例 #1
0
        void IChangeSetHandler.Handle(ChangeSet changes)
        {
            // File system changes are too fast in OSX world.
            if (!Platform.IsWindows)
            {
                Thread.Sleep(500);
            }

            _connector.SendMessageToClient(new RefreshPage());
        }
コード例 #2
0
        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();
            }


        }
コード例 #3
0
ファイル: TrackedSet.cs プロジェクト: storyteller/Storyteller
        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;

        }
コード例 #4
0
        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);
            });
        }
コード例 #5
0
 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));
 }
コード例 #6
0
 void IChangeSetHandler.Handle(ChangeSet changes)
 {
     Console.WriteLine("Detected binary file changes at {0}: {1}", _watcher.Root, changes);
     _callback();
 }
コード例 #7
0
            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());
            }