2020-10-01 05:37:46 +02:00
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2024-09-16 16:09:43 -04:00
|
|
|
|
2020-10-01 05:37:46 +02:00
|
|
|
using Microsoft.Plugin.Folder.Sources;
|
|
|
|
|
using Microsoft.Plugin.Folder.Sources.Result;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.Plugin.Folder
|
|
|
|
|
{
|
|
|
|
|
internal class UserFolderProcessor : IFolderProcessor
|
|
|
|
|
{
|
|
|
|
|
private readonly FolderHelper _folderHelper;
|
|
|
|
|
|
|
|
|
|
public UserFolderProcessor(FolderHelper folderHelper)
|
|
|
|
|
{
|
|
|
|
|
_folderHelper = folderHelper;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IEnumerable<IItemResult> Results(string actionKeyword, string search)
|
|
|
|
|
{
|
|
|
|
|
return _folderHelper.GetUserFolderResults(search)
|
|
|
|
|
.Select(item => CreateFolderResult(item.Nickname, item.Path, item.Path, search));
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-28 13:37:13 +03:00
|
|
|
private static UserFolderResult CreateFolderResult(string title, string subtitle, string path, string search)
|
2020-10-01 05:37:46 +02:00
|
|
|
{
|
|
|
|
|
return new UserFolderResult
|
|
|
|
|
{
|
|
|
|
|
Search = search,
|
|
|
|
|
Title = title,
|
|
|
|
|
Subtitle = subtitle,
|
|
|
|
|
Path = path,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|