private void SetCommands(IEnumerable <AbstractCommand> commands) { //Clear old commands CommandTracker.DeleteCommands(); //Set given commands commands.ToList().ForEach(c => CommandTracker.AddCommand(c)); }
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); }
public WorkManager(IFileSystemIterator iterator, IScrapHeap scrapHeap) { CommandTracker = new CommandTracker(); Iterator = iterator; ScrapHeap = scrapHeap; }