mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Made Plugin Folder Unit tests & Expanding enviroment search (#6600)
* Made Plugin Folder Unit tests. Fixes '>' not recursive searching (with max). Added that paths with an UnauthorizedAccessException are ignored. Added expanding enviroment search. * Fixed some merging errors * Added feedback from review * Made the change that ryanbodrug-microsoft suggested * Stupid merge request... fixed Co-authored-by: p-storm <paul.de.man@gmail.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// 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;
|
||||
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));
|
||||
}
|
||||
|
||||
private static IItemResult CreateFolderResult(string title, string subtitle, string path, string search)
|
||||
{
|
||||
return new UserFolderResult
|
||||
{
|
||||
Search = search,
|
||||
Title = title,
|
||||
Subtitle = subtitle,
|
||||
Path = path,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user