Beispiel #1
0
        private void addToBuffer(ChangedFile file)
        {
            if (Directory.Exists(file.FullName))
            {
                return;
            }
            var fileChangeProdiver = true;

            _solutionHanlder.Consume(file);
            _rebuildMarker.HandleProjects(file);
            if (_bus.BuildProvider != null)
            {
                fileChangeProdiver = !_bus.BuildProvider.Equals("NoBuild");
            }
            if (fileChangeProdiver && !_configuration.WatchAllFiles && !((isProjectFile(file.FullName) && _cache.Get <Project>(file.FullName) != null) || _cache.IsProjectFile(file.FullName)))
            {
                return;
            }
            if (!_validator.ShouldPublish(getRelativePath(file.FullName)))
            {
                return;
            }

            lock (_padLock)
            {
                if (_buffer.FindIndex(0, f => f.FullName.Equals(file.FullName)) < 0)
                {
                    _buffer.Add(file);
                    reStartTimer();
                }
            }
        }
        public void Consume(FileChangeMessage message)
        {
            Debug.ConsumingFileChange(message);
            _solutionHanlder.Consume(message.Files);
            _rebuildMarker.HandleProjects(message);
            var totalListOfProjects = new List <ChangedFile>();
            var locators            = _services.LocateAll <ILocateProjects>();

            foreach (var file in message.Files)
            {
                var projects = getProjectsClosestToChangedFile(file, locators);
                combineLists(projects, totalListOfProjects);
            }
            publishProjects(totalListOfProjects);
        }