public async Task <IList <TransferPath> > SearchLocalSourcePathsAsync(CancellationToken token) { Console2.WriteStartHeader("Search Paths"); string searchLocalPath = Path.Combine(Environment.CurrentDirectory, "Resources"); var paths = new List <TransferPath>(); long totalFileCount = 0; long totalByteCount = 0; var logger = this.CreateTransferLog(); var sourceNode = NodeParser.Node() .WithContext(NullNodeContext.Instance) .WithPath(searchLocalPath) .Parse <IDirectory>(); INode[] sourceNodes = { sourceNode }; var pathEnumerator = EnumerationBuilder.ForUpload(logger, Guid.NewGuid()) .StartFrom(sourceNodes) .WithStatistics(new SynchronousHandler <EnumerationStatistic>( statistic => { totalFileCount = statistic.TotalFiles; totalByteCount = statistic.TotalBytes; })) .Create(); var stopWatch = new Stopwatch(); stopWatch.Start(); await Task.Run(() => { paths.AddRange(pathEnumerator.LazyEnumerate(token) .Select(node => new TransferPath(node.AbsolutePath))); }, token).ConfigureAwait(false); stopWatch.Stop(); this._consolePrinter.DisplaySearchSummary(sourceNode, stopWatch, totalFileCount, totalByteCount); return(paths); }