Пример #1
0
        public FileChangeWatcher(string root, FileSet fileSet, IChangeSetHandler handler)
        {
            _files = new ApplicationFiles(root);
            _fileSet = fileSet;
            _handler = handler;

#if NET46
            _timer = new Timer(execute);
#else
            _timer = new Timer(execute, this, 0, PollingIntervalInMilliseconds);
#endif


            Root = root;
        }
        private IEnumerable<OutlineFile> theWrittenFiles()
        {
            var directory = Context.Service<DocSettings>().Root;
            var top = new OutlineReader(_outlineFile).ReadFile();

            OutlineWriter.WriteToFiles(directory, top);

            var fileSet = new FileSet
            {
                Include = "*.md;order.txt"
            };

            return new FileSystem().FindFiles(directory, fileSet).Select(file =>
            {
                return new OutlineFile
                {
                    Path = file.PathRelativeTo(directory).Replace(Path.DirectorySeparatorChar, '/'),
                };
            });
        } 
Пример #3
0
 public bool Equals(FileSet other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Include, Include) && Equals(other.Exclude, Exclude) && other.DeepSearch.Equals(DeepSearch);
 }