public AddResultAssemblies ( IEnumerable |
||
matches | IEnumerable |
|
Результат | void |
public void FindAssemblies(Query query, bool defaultToAll = false) { string assemblyName = query.GetSearchTermForAssemblySearch(); if (assemblyName == null) { if (defaultToAll) { query.AddResultAssemblies(GetAllListedAssemblies()); } return; } bool isQuoted = false; assemblyName = Query.StripQuotes(assemblyName, out isQuoted); var search = new SortedSearch(i => this.assemblies[i].AssemblyName, this.assemblies.Count); int low, high; search.FindBounds(assemblyName, out low, out high); if (high >= low) { var result = Enumerable .Range(low, high - low + 1) .Where(i => !isQuoted || assemblies[i].AssemblyName.Length == assemblyName.Length) .Select(i => assemblies[i]) .Where(a => a.ProjectKey != -1) .Take(MaxRawResults) .ToList(); query.AddResultAssemblies(result); } }
public void FindAssemblies(Query query, bool defaultToAll = false) { string assemblyName = query.GetSearchTermForAssemblySearch(); if (assemblyName == null) { if (defaultToAll) { query.AddResultAssemblies(GetAllListedAssemblies()); } return; } bool isQuoted = false; assemblyName = Query.StripQuotes(assemblyName, out isQuoted); var search = new SortedSearch(i => this.assemblies[i].AssemblyName, this.assemblies.Count); int low, high; search.FindBounds(assemblyName, out low, out high); if (high >= low) { var result = Enumerable .Range(low, high - low + 1) .Where(i => !isQuoted || assemblies[i].AssemblyName.Length == assemblyName.Length) .Select(i => assemblies[i]) .Where(a => a.ProjectKey != -1) .Take(MaxRawResults) .ToList(); query.AddResultAssemblies(result); } }