예제 #1
0
 private void SetCommands(IEnumerable <AbstractCommand> commands)
 {
     //Clear old commands
     CommandTracker.DeleteCommands();
     //Set given commands
     commands.ToList().ForEach(c => CommandTracker.AddCommand(c));
 }
예제 #2
0
        private void RunDelete(string directory)
        {
            //create a stream of files and directories from the given root directory
            var fileStream = Iterator.Iterate(directory);

            //filter with given commands and create a stream of garbage
            var scrapStream = CommandTracker.FilterFileSystemEntityStream(fileStream);

            //clean the garbage with the given delete action
            ScrapHeap.BurnScrap(scrapStream);
        }
예제 #3
0
 public WorkManager(IFileSystemIterator iterator, IScrapHeap scrapHeap)
 {
     CommandTracker = new CommandTracker();
     Iterator = iterator;
     ScrapHeap = scrapHeap;
 }
예제 #4
0
 public WorkManager(IFileSystemIterator iterator, IScrapHeap scrapHeap)
 {
     CommandTracker = new CommandTracker();
     Iterator       = iterator;
     ScrapHeap      = scrapHeap;
 }