void AllResults(WorkerResult lastResult, WorkerResult newResult, CancellationToken token) { newResult.filteredCommands = new List <Command> (); bool startsWithLastFilter = lastResult != null && lastResult.pattern != null && newResult.pattern.StartsWith(lastResult.pattern) && lastResult.filteredCommands != null; IEnumerable <Command> allCommands = startsWithLastFilter ? lastResult.filteredCommands : IdeApp.CommandService.GetCommands(); foreach (Command cmd in allCommands) { token.ThrowIfCancellationRequested(); SearchResult curResult = newResult.CheckCommand(cmd); if (curResult != null) { newResult.filteredCommands.Add(cmd); newResult.results.AddResult(curResult); } } }
void AllResults (WorkerResult lastResult, WorkerResult newResult, CancellationToken token) { newResult.filteredCommands = new List<Command> (); bool startsWithLastFilter = lastResult != null && lastResult.pattern != null && newResult.pattern.StartsWith (lastResult.pattern) && lastResult.filteredCommands != null; IEnumerable<Command> allCommands = startsWithLastFilter ? lastResult.filteredCommands : IdeApp.CommandService.GetCommands (); foreach (Command cmd in allCommands) { token.ThrowIfCancellationRequested (); SearchResult curResult = newResult.CheckCommand (cmd); if (curResult != null) { newResult.filteredCommands.Add (cmd); newResult.results.AddResult (curResult); } } }