Example #1
0
        private List <FileSystemWatcher> CreateMonitorsForAllPaths()
        {
            var watchers = new List <FileSystemWatcher>();
            var paths    = _expander.Expand(_configuration.MonitorRoots.Select(s => s.SourcePath));

            foreach (var path in paths)
            {
                watchers.Add(new FileSystemWatcher(path)
                {
                    IncludeSubdirectories = true
                });
            }

            return(watchers);
        }
Example #2
0
        protected virtual void HandleCellGeneration()
        {
            //Build Path
            regions.ForEach(x => PathBuilder.BuildPath(ref x));

            var test = CellCollection.cells;

            //Expand / Decay Cells
            regions.ForEach(x => {
                PathExpander.Expand(ref x);
                PathExpander.Proliferate(ref x);
                PathExpander.DecayCells(ref x);
            });

            regions.ForEach(x => PathExpander.CleanIsolatedCells(x));
        }
Example #3
0
        public override int Execute()
        {
            if (!Context.ContainsKey("file"))
            {
                return 0;
            }

            IList<string> files;

            try
            {
                var paths = new PathExpander();
                var recursive = Context.ContainsKey("recursive");
                files = paths.Expand(Environment.CurrentDirectory, Context["file"], recursive);
            }
            catch (InvalidPathException e)
            {
                Context.Error.WriteLine(e.Message);

                return 1;
            }

            if (files.Count > 0)
            {
                Task.BeforeAllExecute();

                foreach (var file in files)
                {
                    if (!ExecuteTask(file))
                    {
                        return 1;
                    }
                }

                Task.AfterAllExecute();
            }

            return 0;
        }