public async Task <List <string> > Do(IEntity curDirect, IEntity selectedItem, CancellationTokenSource cts = null, Progress <int> progressChanger = null) { IEntity item = EntityFunctions.GetItem(curDirect, selectedItem); List <string> result; if (find == null) { result = await asyncFind.FindDataAsync(item.GetItemOfAllFiles(), cts, progressChanger); } else { result = find.FindData(item.GetItemOfAllFiles(), cts, progressChanger); } return(result.Distinct().ToList()); }
public void ThreadsFindClick(IEntity selectedItem) { var cts = new CancellationTokenSource(); Wait wait = new Wait(cts); wait.Show(); ResOfFindData resOf = new ResOfFindData(); IParallelFind find = new ThreadsFind(); List <string> res = find.FindData(EntityFunctions.GetItem(curDirectory, selectedItem).GetItemOfAllFiles(), cts, new Progress <int>(wait.ChangeProgress)); foreach (var el in res) { resOf.AddListEl(el); } wait.Close(); resOf.CopyOllInListView(); resOf.Show(); }