コード例 #1
0
        public void StartWatching(IBrowserRefresher refresher)
        {
            _refresher = refresher;

            _watcher = new FileChangeWatcher(_settings.Root, FileSet.Deep("*.*"), this);
            _watcher.Start();
        }
コード例 #2
0
        public void StartWatching(IBrowserRefresher refresher)
        {
            _refresher = refresher;

            _watcher = new FileChangeWatcher(_settings.Root, FileSet.Deep("*.*"), this);
            _watcher.Start();
        }
コード例 #3
0
        public void StartWatching(string path, ISpecFileObserver observer)
        {
            var fullPath = path.ToFullPath();
            _watcher = new FileChangeWatcher(fullPath, FileSet.Deep("*.xml"), this);
            _watcher.Start();

            _observer = observer;
        }
コード例 #4
0
        public void StartWatching(string path, ISpecFileObserver observer)
        {
            var fullPath = path.ToFullPath();

            _watcher = new FileChangeWatcher(fullPath, FileSet.Deep("*.xml"), this);
            _watcher.Start();

            _observer = observer;
        }
コード例 #5
0
        public void Start(OpenInput input)
        {
            // You'd think it'd be the other way around
            if (!input.HotReloadFlag)
            {
                _watcher.Start();
            }

            _watcherAssets.Start();
        }
コード例 #6
0
        public void no_changes()
        {
            write("foo.txt", "1");
            write("bar.txt", "2");
            write("baz.txt", "3");

            using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this))
            {
                watcher.Start();

                Thread.Sleep(2000);

                LastChanges.ShouldBeNull();
            }
        }
コード例 #7
0
        public void no_changes()
        {
            write("foo.txt", "1");
            write("bar.txt", "2");
            write("baz.txt", "3");

            using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this))
            {
                watcher.Start();

                Thread.Sleep(2000);

                LastChanges.ShouldBeNull();
            }
        }
コード例 #8
0
        public void see_adds()
        {
            write("foo.txt", "1");
            write("bar.txt", "2");
            write("baz.txt", "3");

            using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this))
            {
                watcher.Start();

                write("new.txt", "I am new");

                Wait.Until(() => LastChanges != null).ShouldBeTrue();

                LastChanges.Added.Single().RelativePath.ShouldBe("new.txt");
            }
        }
コード例 #9
0
        public void WatchBinariesAt(string directory)
        {
            Console.WriteLine("Watching for binary and config file changes at " + directory);

            var fileSet = FileSet.Deep("*.dll;*.config;*.exe");
            if (Exclude.IsNotEmpty())
            {
                fileSet.Exclude = Exclude;
            }

            _watcher = new FileChangeWatcher(directory, fileSet, this)
            {
                ChangeBuffer = 500
            };

            _watcher.Start();
        }
コード例 #10
0
        public void see_adds()
        {
            write("foo.txt", "1");
            write("bar.txt", "2");
            write("baz.txt", "3");

            using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this))
            {
                watcher.Start();

                write("new.txt", "I am new");

                Wait.Until(() => LastChanges != null).ShouldBeTrue();

                LastChanges.Added.Single().RelativePath.ShouldBe("new.txt");
            }
        }
コード例 #11
0
        public void see_deletes()
        {
            write("foo.txt", "1");
            write("bar.txt", "2");
            write("baz.txt", "3");

            using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this))
            {
                watcher.Start();

                File.Delete(theDirectory.AppendPath("foo.txt"));
                File.Delete(theDirectory.AppendPath("baz.txt"));

                Wait.Until(() => LastChanges != null).ShouldBeTrue();

                LastChanges.Deleted.OrderBy(x => x)
                .ShouldHaveTheSameElementsAs("baz.txt", "foo.txt");
            }
        }
コード例 #12
0
        public void see_changes()
        {
            write("foo.txt", "1");
            write("bar.txt", "2");
            write("baz.txt", "3");

            using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this))
            {
                watcher.Start();

                write("foo.txt", "different");
                write("baz.txt", "different");

                Wait.Until(() => LastChanges != null).ShouldBeTrue();

                LastChanges.Changed.OrderBy(x => x.RelativePath).Select(x => x.RelativePath)
                    .ShouldHaveTheSameElementsAs("baz.txt", "foo.txt");
            }
        }
コード例 #13
0
        public void see_changes()
        {
            write("foo.txt", "1");
            write("bar.txt", "2");
            write("baz.txt", "3");

            using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this))
            {
                watcher.Start();

                write("foo.txt", "different");
                write("baz.txt", "different");

                Wait.Until(() => LastChanges != null).ShouldBeTrue();

                LastChanges.Changed.OrderBy(x => x.RelativePath).Select(x => x.RelativePath)
                .ShouldHaveTheSameElementsAs("baz.txt", "foo.txt");
            }
        }
コード例 #14
0
        public void WatchBinariesAt(string directory)
        {
            Console.WriteLine("Watching for binary and config file changes at " + directory);

            var fileSet = FileSet.Deep("*.dll;*.config;*.exe");

            if (Exclude.IsNotEmpty())
            {
                fileSet.Exclude = Exclude;
            }

            _watcher = new FileChangeWatcher(directory, fileSet, this)
            {
                ChangeBuffer = 500
            };



            _watcher.Start();
        }
コード例 #15
0
 public void Start()
 {
     _watcher.Start();
 }
コード例 #16
0
 public void StartWatching()
 {
     _watcher.Start();
 }
コード例 #17
0
 public void StartWatching()
 {
     _appDomainWatcher.StartWatching();
     _watcher.Start();
 }
コード例 #18
0
        public void see_deletes()
        {
            write("foo.txt", "1");
            write("bar.txt", "2");
            write("baz.txt", "3");

            using (var watcher = new FileChangeWatcher(theDirectory, FileSet.Shallow("*.txt"), this))
            {
                watcher.Start();

                File.Delete(theDirectory.AppendPath("foo.txt"));
                File.Delete(theDirectory.AppendPath("baz.txt"));

                Wait.Until(() => LastChanges != null).ShouldBeTrue();

                LastChanges.Deleted.OrderBy(x => x)
                    .ShouldHaveTheSameElementsAs("baz.txt", "foo.txt");
            }
        }
コード例 #19
0
 public void Start()
 {
     _watcher.Start();
     _watcherAssets.Start();
 }