Skip to content

Commit 62397aa

Browse files
author
Declan Taylor
committed
Fixed summary for MakeSuggestions
1 parent 0d6b973 commit 62397aa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/Demos/CachedPathSuggestBoxDemo/Infrastructure/CachedPathInformationSuggest.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
namespace CachedPathSuggestBoxDemo.Infrastructure
99
{
1010

11-
1211
public class CachedPathInformationSuggest :ISuggest
1312
{
13+
private static readonly int NumberOfResultsReturned = 5;
14+
1415
public void Insert(string path)
1516
{
1617
var fileInfo =new FileInfo(path);
@@ -25,8 +26,8 @@ public void Insert(string path)
2526
}
2627

2728
/// <summary>
28-
/// Makes suggestions of paths based on match between query and the name of the path.
29-
/// Only returns latest 3 results. Newest first.
29+
/// Makes suggestions of paths based on match between query and the full-name of the path.
30+
/// Only returns latest <see cref="NumberOfResultsReturned"/> results (newest first).
3031
/// </summary>
3132
/// <inheritdoc cref="MakeSuggestions"/>
3233
/// <example>
@@ -48,7 +49,7 @@ where item.Name.Contains(queryThis, StringComparison.CurrentCultureIgnoreCase)
4849

4950
static PathInformation[] GetPathInformations(string key)
5051
{
51-
return LiteRepository.Instance.Filter(key).OrderByDescending(a => a.Value).Take(5).Select(a => new PathInformation(a.Key)).ToArray();
52+
return LiteRepository.Instance.Filter(key).OrderByDescending(a => a.Value).Take(NumberOfResultsReturned).Select(a => new PathInformation(a.Key)).ToArray();
5253
}
5354
}
5455
}

0 commit comments

Comments
 (0)