예제 #1
0
        public void has_changes_positive_with_any_deleted()
        {
            var set = new ChangeSet();
            set.Deleted.Add(new StubFubuFile("foo", DateTime.Now).RelativePath);

            set.HasChanges().ShouldBeTrue();
        }
예제 #2
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());
            }
예제 #3
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();
            }


        }
예제 #4
0
        public ChangeSet DetectChanges(IEnumerable<IFubuFile> files)
        {
            var changeSet = new ChangeSet();

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

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


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

            return changeSet;

        }
예제 #5
0
 void IChangeSetHandler.Handle(ChangeSet changes)
 {
     _connector.SendMessageToClient(new RefreshPage());
 }
예제 #6
0
 public void Handle(ChangeSet changes)
 {
     _observer.RefreshContent();
 }
예제 #7
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));
 }
 void IChangeSetHandler.Handle(ChangeSet changes)
 {
     LastChanges = changes;
 }
        public void SetUp()
        {
            LastChanges = null;

            theDirectory = Guid.NewGuid().ToString().ToFullPath();
            Directory.CreateDirectory(theDirectory);
        }
예제 #10
0
        public void has_changes_negative()
        {
            var set = new ChangeSet();

            set.HasChanges().ShouldBeFalse();
        }
 void IChangeSetHandler.Handle(ChangeSet changes)
 {
     Console.WriteLine("Detected binary file changes at {0}: {1}", _watcher.Root, changes);
     _callback();
 }