public async Task Execute(Arguments arguments)
        {
            PresentBlackListRequest request = new()
            {
                PotName       = PotName,
                BlackListName = BlackListName
            };

            BlackList = await requestBus.PlaceRequest <PresentBlackListRequest, DiskPathCollection>(request);
        }
    }
        private BlackList GetBlackList(SnapshotLocation snapshotLocation)
        {
            if (snapshotLocation.PotName == null)
            {
                return(null);
            }

            DiskPathCollection blackListPaths = blackListRepository.Get(snapshotLocation.PotName);

            return(new BlackList(blackListPaths));
        }
        // todo: Instead of receiving an IRemoveDuplicatesExporter, make this handler async and return a promise.
        // The real work will run asynchronously, while the promise will raise events whenever something important
        // happened that the presentation layer should handle.
        protected override void Handle(RemoveDuplicatesRequest request)
        {
            this.request = request;

            DiskPathCollection blackListPathsLeft = blackListRepository.Get(request.SnapshotLeft.PotName);
            BlackList          blackListLeft      = new(blackListPathsLeft);

            DiskPathCollection blackListPathsRight = blackListRepository.Get(request.SnapshotRight.PotName);
            BlackList          blackListRight      = new(blackListPathsRight);

            FileDuplicates fileDuplicates = new()
            {
                FilesLeft           = snapshotRepository.EnumerateFiles(request.SnapshotLeft, blackListLeft).ToList(),
                FilesRight          = snapshotRepository.EnumerateFiles(request.SnapshotRight, blackListRight).ToList(),
                CheckFilesExistence = true
            };

            RemoveDuplicates(fileDuplicates);
        }
 public DiskReaderStartingEventArgs(DiskPathCollection blackList)
 {
     BlackList = blackList;
 }
示例#5
0
 public DirectoryCrawler(string path, DiskPathCollection blackList)
 {
     this.path      = path ?? throw new ArgumentNullException(nameof(path));
     this.blackList = blackList ?? throw new ArgumentNullException(nameof(blackList));
 }
示例#6
0
        public BlackList(DiskPathCollection paths)
        {
            IEnumerable <BlackPath> blackPaths = paths.Select(x => new BlackPath(x));

            AddRange(blackPaths);
        }